0
How do i get a var to multiply a number such as 0.01666
this is only part of the code to be implemented into my "Calculate Hours" code and the situation is this on the calculate hours code to properly account for time i had ro convert the minutes into a decimal by dividing the amount of minutes by 60 well this code is supposed to do the opposite by only multiplying the first 5 number after the decimal but but including "0." in front of it so if i put say 0.01666 it should come out as 1 but it comes out as a zero i tried it with a whole number and it worked and then 1.5 i only got 60 instead of 90 so i figured out it ignored everything past the decimal and my question is how do i get it to work with the numbers past the decimal point https://code.sololearn.com/WQzsrn02N4DP/?ref=app
3 Respuestas
+ 2
Line 14: replace parseInt() with parseFloat()
+ 1
Thanks Anna
+ 1
You're welcome 😀