Format decimal

Hi,

Is there a possibility I can use a wildcard to format my decimal points?

My problem is that I’m trying to display decimal values but I don’t want to limit the number of decimals. So, if my calculated answer is 0.1988 or 0.1 it’ll display just as it is. But if I didn’t format my result, it’ll display .123 if it’s 0.123.

Any suggestions are welcome. Thanks

Subject: format decimal

If you just use @Text with no format specified (in formula) or Cstr (in LS) it will usually display just the significant digits.

One thing to watch out for. Results of floating point calculations can sometimes be off if you go far enough out, so a result value of 1.5 might actually show as something like 1.499999999999999999999999, so you might want to round the number to the maximum number of decimal places you’re willing to show.

Subject: RE: format decimal

Thanks for your response Stephen. I’ve tried the two ways suggested by you but I’m still getting .1111 instead of 0.1111.

Subject: RE: format decimal

If you want to force a leading zero, try:Format(num,“0.#############”)

Subject: RE: format decimal

hahaha…that was exactly what I did…but I was afraid that I did not put enough #s

thanks anyways…I really appreciate it…