Float without comma
Hello,
I would like to have a float, that has 4 decimal points without an comma. Example: 0001 How do I do this?
Sincerely, Mik
Comment
Best Answer
Answer by Reynarz · Oct 21, 2017 at 02:57 PM
Something like this?
float value = 12.0032f;
string stringValue = value.ToString().Replace(".", string.Empty);
float newValue = float.Parse(stringValue);
Debug.Log("Value is " + newValue);
Yes, like this, thanks! But do you know any better solution for predecimals?
$$anonymous$$mm predecimals? give me an example, i don't know what is a "Predecimal".
With "predecimals" I mean this: 00.40 But its solved, thanks anyway.
Your answer
Follow this Question
Related Questions
Make a float display 10:07 instead of 10.7 2 Answers
How to get type double to vector3? 0 Answers
float adds decimal points over time 2 Answers