Re: rounding to 9's



Hi Jonathan -

Have you tried rounding to the nearest tenth and subtracting one
hundreth?

Dim myVal As Double
myVal = 41.87
myVal = Math.Round(myVal, 1) - 0.01
Debug.WriteLine(myVal) 'Returns 41.89

myVal = 41.84
myVal = Math.Round(myVal, 1) - 0.01
Debug.WriteLine(myVal) 'Returns 41.79

....sometimes the simplest approaches work the best.

Happy Coding,

-Mark

.



Relevant Pages

  • Re: rounding to 9s
    ... Have you tried rounding to the nearest tenth and subtracting one ...
    (microsoft.public.dotnet.languages.vb)
  • Re: rounding to 9s
    ... Have you tried rounding to the nearest tenth and subtracting one ...
    (microsoft.public.dotnet.languages.vb)
  • Re: The moment the willing suspension of disbelief died
    ... The language is definitely not greek. ... there is a single character for 30, and a single character for 10, ... In fact rounding off to the nearest 10 is perfectly reasonable ...
    (rec.arts.sf.written)
  • Re: converting points to centimeters...
    ... I suppose that Word's rounding to the nearest ... I'm not comfortable with the rounding because it's not controllable - it's ... solution has to be Word 97 compatible and I don't believe there's a Round ... > The problem is not the conversion itself, but the act that Word rounds the ...
    (microsoft.public.word.vba.general)
  • Re: vbscript rounding.
    ... > integers don't have a unique nearest multiple of 500. ... "vbscript rounding", and secondly by using the term "rounding up to the ... In the vernacular of many people, "rounding up to the nearest x" means ... question is worth asking, it's worth posting. ...
    (microsoft.public.scripting.jscript)