small math problem

KingTobiazZz

New Member
Reaction score
1
does anyone know how to do the following in a trigger

I have the integer 564 and I want to know how many times the integer 100 is in it, so the answer should be 5.
but 546 / 100 = 5,46 which is not what I want
 

KingTobiazZz

New Member
Reaction score
1
does anyone know how to do the following in a trigger

I have the integer 564 and I want to know how many times the integer 100 is in it, so the answer should be 5.
but 546 / 100 = 5,46 which is not what I want

i figured it out... :p just need to convert the real to an integer
 

Cookiemaster

New Member
Reaction score
36
but if its more or equal to 550 it will be 6. Is that what you want?

If I recall correctly, converting a real to integer rounds the decimals down to 0.

And if not, well, there's probably a floor (round-down) function somewhere.
 

Sensang

TH.net Regular
Reaction score
7
If I recall correctly, converting a real to integer rounds the decimals down to 0.

And if not, well, there's probably a floor (round-down) function somewhere.

ah ok. I thought he would convert them beforehand... like converting 550 as integer and then dividing by 10. It's still good to be aware of the fact that it might round the other way if its more than .4
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top