• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Int reduce

slaw

Software Developer
Joined
Aug 27, 2007
Messages
3,680
Solutions
126
Reaction score
1,118
Location
Germany
GitHub
slawkens
Mayba someone know how to reduce number?

Eq. I have number returned by some algorithm ;P
0.18616666666667
(111700 / (6000 * 200) - algorithm

How to recude it to: 0.2? Or only 0.18?

Btw.
If no one understand. Now it show "0.18616666666667" in msg, but i only want to show "0.18" or "0.2"
 
Last edited:
string.format("%.2f", 0.23233)

where 2 is the amount of decimals. returns 0.23, but note that 0.3 will become 0.30 :p
 
Back
Top