This is a bit of an embarrasing question, but is there a way to do that that does not involve me using the floor(someInt) function? I know there is an int() a atof, a ftoa, hell there is even a hex(), but no float()?
if not, RFEEEEE!
how do you convert an int to a float in HScript
8842 4 3- grayOlorin
- Member
- 1799 posts
- Joined: Oct. 2010
- Offline
- old_school
- Staff
- 2540 posts
- Joined: July 2005
- Offline
I believe hscript itself has no idea of what is an int. I think everything is float.
Some functions work with integers and will round automatically if you feed in a float).
The functions you listed will strip off remainder leaving whole numbers but they still are floats.
Some functions work with integers and will round automatically if you feed in a float).
The functions you listed will strip off remainder leaving whole numbers but they still are floats.
There's at least one school like the old school!
- grayOlorin
- Member
- 1799 posts
- Joined: Oct. 2010
- Offline
In my case, I brought an int attr via a prim expression then dividing it by a float. This resulted on an integer result, which was bad. In ex and python, I would do the float conversion, but in expression, I got stuck ): floor forces the result to float which did the trick , but it seems strange not to have a float () function
-G
- JulienH
- Member
- 17 posts
- Joined: Nov. 2017
- Offline
- jsmack
- Member
- 7802 posts
- Joined: Sept. 2011
- Offline
-
- Quick Links