D dougc Member Licensed User Longtime User Sep 8, 2012 #1 While searching through the forum (for a way to convert a float to an int) I came across this code Log(ConvertToInt("0100")) so I thought I could use "ConvertToInt" to do the conversion but alas that is not true. Is there a function to convert a float to int or do I have to do it manually? thanks dougc
While searching through the forum (for a way to convert a float to an int) I came across this code Log(ConvertToInt("0100")) so I thought I could use "ConvertToInt" to do the conversion but alas that is not true. Is there a function to convert a float to int or do I have to do it manually? thanks dougc
JonPM Well-Known Member Licensed User Longtime User Sep 8, 2012 #2 Do you need to round the number up and down? or just preserve the whole number? Upvote 0
D dougc Member Licensed User Longtime User Sep 8, 2012 #3 I would prefer to round up thanks dougc Upvote 0
thedesolatesoul Expert Licensed User Longtime User Sep 8, 2012 #4 dougc said: I would prefer to round up Click to expand... B4X: Dim i as int i = Ceil(mynumber) Or use Round or Floor. Upvote 0
dougc said: I would prefer to round up Click to expand... B4X: Dim i as int i = Ceil(mynumber) Or use Round or Floor.