Decimals

So I have an app, and in the app I have a dollar variable. I just use decimals, so one dollar would be represented as $1. But I want it to be represented like this: $1.00 as opposed to just this: $1

If that makes sense, thanks in advance. (Basically I want the zeros to be in there)

Check out string.format.

This results in “1.10” on all values:

print(string.format("%.2f", 1)) print(string.format("%.2f", 1.1)) print(string.format("%.2f", 1.10)) print(string.format("%.2f", 1.100)) 

Best regards,

Tomas

Thanks so much! Works perfectly.

Check out string.format.

This results in “1.10” on all values:

print(string.format("%.2f", 1)) print(string.format("%.2f", 1.1)) print(string.format("%.2f", 1.10)) print(string.format("%.2f", 1.100)) 

Best regards,

Tomas

Thanks so much! Works perfectly.