Decimal points

Posted by Rhinoa on Thu 10 Jan 2002 11:04 AM — 4 posts, 16,792 views.

United Kingdom #0
How can I remove the decimal point from a calculation?

e.g 86 / 3 * 100 = 2766.666666666666666667
(Don't want this bit:   ^^^^^^^^^^^^^^^^^^)

Has to be with VB script..
No idea how to even start it..
~Rhinoa~
Amended on Mon 09 Jun 2003 04:36 PM by Rhinoa
Australia Forum Administrator #1
You can use "cint" (convert to integer). This will round it for you (ie. to the nearest integer).



/world.note cint(2766.666666666666666667)
2767
Australia Forum Administrator #2
You can use "fix" if you want to discard the decimal places (not round) ...


/world.note fix(2766.666666666666666667)
2766
Australia Forum Administrator #3
By the way, if you want to get those arrows right, turn on "Forum Codes" and use the [code] directive.

eg.


[code] 
e.g 86 / 3 * 100 = 2766.666666666666666667 
  (Don't want this bit ^^^^^^^^^^^^^^^^^^^) 
[/code]


'Code' uses a monospaced font and preserves spacing.