[EMAIL PROTECTED] wrote: > I have a habbit of using the following syntax to round numbers to a certain > number of decimal places: > > X = 1.623 > CRT X '2' > CRT X '0' > > Yields: > > 1.62 > 2 > > It's always worked fine. Until we did an upgrade to 10.1. Now it has been > deemed un-reliable because it produced an undesirable result (an empty > string) in a rather sensitive program. > > So, first question is: Is this a bad habbit I've had all these years?
Yes. > > Second question: Has anyone else experienced a problem with this method of > rounding? Is it a known bug? iirc, yes/no. I seem to remember a thread on this list ages back. If you use JUST a number as your format operator, it does not necessarily mean what you think it does. This other thread was about it apparently producing the correct result for ages and then suddenly going "wrong". Basically, the number can either be interpreted as "number of decimal places" or as "string width". That's why another poster suddenly found that "0" returned the empty string! iirc the manual is clear on what is the correct interpretation, but certain implementations do/did get it wrong. As with all these things, it pays to be explicit and not take short cuts ... Cheers, Wol > ------- > u2-users mailing list > [EMAIL PROTECTED] > To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/