This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
TheJebForge's profile picture

Math problem [Solved]

Started by TheJebForge, 04 February 2015 - 12:49 PM
TheJebForge #1
Posted 04 February 2015 - 01:49 PM
How can I left only 2 numbers behind the comma. I mean:
The number: 7.527647763
And must be: 7.53
How can I do that?
Edited on 04 February 2015 - 04:54 PM
MKlegoman357 #2
Posted 04 February 2015 - 02:35 PM
Multiply the number by 100, round it down to whole number (math.floor, math.ceil, etc..) and divide it by 100.
TheJebForge #3
Posted 04 February 2015 - 05:53 PM
Thx