Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"Round down"
#4
I see what you did there, Hazzy.

Fiel, I've been using the following function to floor numbers:
function floor0(number) {
return Math.floor(number*Math.pow(10,0))/Math.pow(10,0);
}
But what do you do when you've got several places this needs to be enacted? For example, this is my Total LUK formula for MS calculations:

tLUKres = floor0((parseInt(inputbLUK)*maple_warrior) + (parseInt(inputbLUK)*(maple_warrior-1)*luk_percent));}

the way I see it, I'd have to calculate everything individually with new variables like this:

a_luk = floor0(parseInt(inputbLUK)*maple_warrior)
b_luk = floor0(parseInt(inputbLUK)*(maple_warrior-1)*luk_percent)

tLUKres = a_luk + b_luk

would that be the best way?

Thank you in advance.
Reply


Messages In This Thread
"Round down" - by RADRaze2KX - 2010-08-24, 04:23 PM
"Round down" - by Hazzy - 2010-08-24, 04:31 PM
"Round down" - by Fiel - 2010-08-24, 05:47 PM
"Round down" - by RADRaze2KX - 2010-08-24, 06:00 PM
"Round down" - by Fiel - 2010-08-24, 06:36 PM
"Round down" - by RADRaze2KX - 2010-08-24, 09:42 PM
"Round down" - by Lord Xela - 2010-08-24, 10:30 PM
"Round down" - by Fiel - 2010-08-24, 10:49 PM
"Round down" - by RADRaze2KX - 2010-08-25, 04:18 PM

Forum Jump:


Users browsing this thread: