red30 Well-Known Member Licensed User Longtime User Sep 29, 2016 #1 B4X: Lable1.Text=Round2((127/64),0) I get a text "1.0" in Lable1. How can I get only an integer part?
B4X: Lable1.Text=Round2((127/64),0) I get a text "1.0" in Lable1. How can I get only an integer part?
DonManfred Expert Licensed User Longtime User Sep 29, 2016 #2 Or use Numberformat Or use the Smart String Literal Upvote 0
M Mahares Expert Licensed User Longtime User Sep 29, 2016 #3 Here are few other options depending on where you want to go with the number up or down: B4X: Log(Round(127/64)) 'displays 2 Log(Floor(127/64)) 'displays 1 Log(Ceil(127/64)) 'displays 2 Upvote 0
Here are few other options depending on where you want to go with the number up or down: B4X: Log(Round(127/64)) 'displays 2 Log(Floor(127/64)) 'displays 1 Log(Ceil(127/64)) 'displays 2
Erel B4X founder Staff member Licensed User Longtime User Sep 30, 2016 #4 You shouldn't use Round or Round2 to convert a number to string. Upvote 0
Roger Daley Well-Known Member Licensed User Longtime User Oct 2, 2016 #5 Have a look at This Post , very instructive on number rounding. Upvote 0