Values not displayed properly?
I have a field with display format set to: #,0.00;-#,0.00.
Could anyone explain me why number eg.
999999.345 is presented as
999999.34 while
999999.545 is presented as
999999.55
as well as
222222.345 is truncated to
222222.35
(look at the least important factor)
I have no idea how to deal with it. Any tips?
Regards,
Joanna
Could anyone explain me why number eg.
999999.345 is presented as
999999.34 while
999999.545 is presented as
999999.55
as well as
222222.345 is truncated to
222222.35
(look at the least important factor)
I have no idea how to deal with it. Any tips?
Regards,
Joanna
This discussion has been closed.
Comments
In #,0.00 the number of "0"s after the dot tells RB the maximum number of
digits that you want to have after the dot. If there are more, they are
truncated and rounded. So if you want to keep your 999999.345, you have to
edit the display format to #,0.000;-#,0.000
regards,
Andreas Kr?gersen
P.S. @DM: Is there any list that contains all types of valid display formats
and tokens available?
Just look at the numbers - some goes up, some down, although the digit part
of the number is the same. Do you see it? Am I missing something or it is a
small bug?
Joanna
U?ytkownik "Andreas Kr?gersen" napisa? w
Could be a bug although I'd be careful with that. RBuilder uses more
significant digits for calculation than there are actually printed/shown. So
it could be a small error while rounding somewhere deep within. But that's a
general problem with rounding of floats. You ALWAYS have an error but you
don't see it usually because it is somewhere around the least significant
digits.
But I'm not totally sure, if that's the problem so I'd like to hear an
official statement from DM, too.
regards
Andreas Kr?gersen
Thanks Andreas, I also hope DM will somehow react to the matter presented in
above posts.
Have a nice weekend,
Joanna
PS. I wouldn't say it is somewhere deeper since these numbers don't come
from my calculations... I've checked double variable with two digit format
directly set to the numbers mentioned and it works the same.
FloatToStrF. You can replace the display formatting as shown in a demo I
can email to you, in order to not call this function and perform your own
formatting routine.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com