L lucasjohnson00 Member Licensed User Longtime User Oct 17, 2012 #1 is there any way to round a decimal to the nearest hundreth?
klaus Expert Licensed User Longtime User Oct 17, 2012 #2 Directly not but this code will do it. B4X: RoundedNumber = Floor(Number / 100 + 0.5) * 100 1049.99 > 1000 1050.00 > 1100 Best regards. Upvote 0
Directly not but this code will do it. B4X: RoundedNumber = Floor(Number / 100 + 0.5) * 100 1049.99 > 1000 1050.00 > 1100 Best regards.
M MLDev Active Member Licensed User Longtime User Oct 17, 2012 #3 This works also: B4X: RoundedNumber = Round2(Number, 2) EDIT @klaus I just noticed that code is wrong. It should be: B4X: RoundedNumber = Floor(Number * 100 + 0.5) / 100 Last edited: Oct 17, 2012 Upvote 0
This works also: B4X: RoundedNumber = Round2(Number, 2) EDIT @klaus I just noticed that code is wrong. It should be: B4X: RoundedNumber = Floor(Number * 100 + 0.5) / 100