PtokaX forum

Development Section => LUA & PtokaX-Scripting-Interface => Topic started by: BossiDeLeon on 31 May, 2005, 03:05:55

Title: Formating decimals in PtokaX 0.3.3.0 build 17.02
Post by: BossiDeLeon on 31 May, 2005, 03:05:55
hey again,

i need to be able to output numbers in a certain decimal format, like say just 2 decimal places. how can this be done with PtokaX 0.3.3.0 build 17.02?

thanks!
Title:
Post by: jiten on 31 May, 2005, 09:37:37
Well, if you want two decimal places, try this one:
string.format("%0.2f",(x/y))Where "2" means how many decimal places and "x" and "y" are the values.

Cheers
Title:
Post by: BossiDeLeon on 31 May, 2005, 19:17:59
works like a charm!

thanks jiten!
Title:
Post by: jiten on 31 May, 2005, 21:05:38
You're welcome m8.