ID:148648
 
I was just wondering, but I'm putting a number to the screen that has decimal places in it some of the time, but not all the time. Is there a way to force the decimal place to show even if the number is a whole number? Here's an example...

12.4 -> 12.4
13.2 -> 13.2
5.0 -> 5

See what I mean?
You could make a string out of the number, and search the string for a decimal point. If it deosn't have a decimal point, then add a ".0" to the end of the string. I'm not sure if there is a simpler way, but that's how I'd do it.
In response to OneFishDown
That is the only way, it seems. The thing is, BYOND uses a single variable, and behind the scenes, when you change a variable, it decides what it fits most (double, float, int, String) and automatically casts it to that. This adds simplicity, but makes it harder to do something that would be as simple as (in Java) B = (double)(B).