Hi all there are some way to round the numbers before the zero?
for example, i have the function: TrdQty = IntPortion (Capital / close);
this results should be for eg: 3663 but i would like to have 3660 - 3665 etc...
i know perfectly the function: JK_Math_RoundToNearest. but that works only for fraction after the zero, for eg: JK_Math_RoundToNearest(100.58, 0.25) -> 100.50.
could you help me?
thanks
walter
Rounding before the zero [SOLVED]
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Rounding before the zero
Hi all there are some way to round the numbers before the zero?
for example, i have the function: TrdQty = IntPortion (Capital / close);
this results should be for eg: 3663 but i would like to have 3660 - 3665 etc...
i know perfectly the function: JK_Math_RoundToNearest. but that works only for fraction after the zero, for eg: JK_Math_RoundToNearest(100.58, 0.25) -> 100.50.
could you help me?
thanks
walter
Please give specific and comprehensive examples of what you would like to do.
e.g.
xxxx should be converted to XXX
yyy should be converted to YYYY
zzzzz should be converted to ZZZZ
Re: Rounding before the zero [SOLVED]
Code: Select all
Value1 = Round(Value1 * 0.1, 0) * 10 ; //to round to 10
or
Value1 = Round(Value1 * 0.2, 0) * 5 ;//to round to 5