Posted 09 December 2018 - 07:58 PM
Hey all, so I'm stuck with a question, how to print float number digits, without stringifying it, only using math… and telling at which position the dot went
Input: 3.14
Output: 3, (dot here), 1, 4
I know how to get all digits in an integer:
HELWP! Thanks…
Input: 3.14
Output: 3, (dot here), 1, 4
I know how to get all digits in an integer:
local i = 0
local num = 12345
while num >= 1 do
print( num % 10 )
num = math.floor( num / 10 )
i = i + 1
end
print( "Number of digits: " .. i )
HELWP! Thanks…
Edited on 09 December 2018 - 07:00 PM