Android Question Always round down to number without decimals

TrisectDevelopment

Active Member
Licensed User
Longtime User
I'm having a problem with numbers.
I have the number 4.567 and I only want the number 4.
Examples:
Number what I want
4.434 4
4.678 4
3.212 3
3.898 3

You get the point!
Is this possible?

I tried Round and Round2 and some other stuff found on the forum, but I cant figure it out.
 

eps

Expert
Licensed User
Longtime User
Upvote 0

mangojack

Expert
Licensed User
Longtime User
Agree with eps ..TD is not really wanting to round off .. just wants the first digit / digits . (going on example)
So for simplicity .. why could you not just send to integer ?

B4X:
Dim d1 As Double = 4.434 4
'Dim d2 As Double = 4.678 4
'Dim d3 As Double = 3.212 3
'Dim d4 As Double = 3.898 3

Dim i As Int = d1
Log (i)
..' tried to get an array going , but getting late (again !)
 
Last edited:
Upvote 0
Top