This question was
closed Sep 27, 2017 at 02:47 PM by
SharkoFR for the following reason:
The question is answered, right answer was accepted
Float superior or inferior not working
Hi
public class SystemStuff : MonoBehaviour {
public int Hourtxt;
public Text text1;
//public Text text2;
public Text betatxt;
public Text DayText;
public float HourTestText;
public string HrString;
public float Hr;
public Text timetext;
public int DayHour;
// Use this for initialization
void Start () {
Debug.Log(System.DateTime.Now.Hour +"." +System.DateTime.Now.Minute);
Debug.Log(System.DateTime.Now.DayOfWeek);
}
// Update is called once per frame
void Update () {
if (Hr >= 8.10 && Hr <= 9.4)
{
Hourtxt = 1;
}
else
{
Hourtxt = 0;
}
When Hr is under 8 HourTxt is set to 0 but when Hr = 8.1 Hourtxt = 1 but i want that HourTxt is set to 1 only when Hr > 8.10
Comment
Best Answer
Answer by SharkoFR · Sep 27, 2017 at 02:46 PM
I find a way to do this, my error was that i take 04 for 4 and in decimal 4 = 40 so i made a string.format to transform 4 to 04.