Rank: Member
Groups: Registered, Registered Users Joined: 11/15/2006(UTC) Posts: 13 Location: Australia, South Australia, Adelaide
|
Hello everybody,
Can someone enlighten me as to how i might be able to round down from 6 to 2 decimal places.
I have tried prec, floor, int, ceiling but they all truncate the numbers.
Any help would be appreciated
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 11/15/2006(UTC) Posts: 13 Location: Australia, South Australia, Adelaide
|
Sorry everyone i should be more specific i would like to turn say 6.06825 into 6.07 and not down to 6.06. I am having some troubles where my trades arent exiting because of .001 cent.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
As MS truncates number.... add a .x5 after the number of decimal places you want, then truncate:
If you want to round 6.06825 to two decimal places: 6.06825 + 0.005 = 6.07325 and truncate this at two decimal places = 6.07
6.04999 + 0.005 = 6.05499 => 6.05 etc
Hope this helps.
wabbit [:D]
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 1/19/2005(UTC) Posts: 1,065 Location: Koh Pha-Ngan, Earth
Was thanked: 2 time(s) in 2 post(s)
|
Check out the accurate rounding indicator code available from MetaStockTools.com :
"Rounding - rounds off any numerical value to nearest specified decimal place or integer."
jose '-)
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 11/15/2006(UTC) Posts: 13 Location: Australia, South Australia, Adelaide
|
Thankyou everyone problem solved
Regards
Pieter
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.