[Wtr-general] Rounding values
Michael Bolton
mb at michaelbolton.net
Thu Jul 20 11:18:54 EDT 2006
>I want to verify if the text is correctly displayed depending on
different input scenarios. The web application however rounds values,
e.g. if the calculated result is 170500 then displayed should be
180000.
>How can i do same in Ruby/Watir?
I'm not sure I understand the question and the context. Is there a decimal
point involved? Are you trying to round up to some ceiling of thousands?
Can you express your rounding rules in English or math? If so, we can
probably help you to write some Ruby code to do it. Otherwise, there are
lots of ways to interpret the single example you've given, and all but one
of those interpretations will be wrong.
Note that there are different kinds of rounding in different kinds of
contexts.
http://en.wikipedia.org/wiki/Rounding
---Michael B.
More information about the Wtr-general
mailing list