I'm trying to hide decimals and zeros when they're not needed. For instance, if I type 3 I'd like to show as 3 instead of 3.00, and if I type 3.5 I'd like it to show 3.5 instead of 3.50. I can't find how to do this but surely it can be done.
Thanks.
missinglinq is correct in that we need more information, but if you need to format the results of numeric calculations to,
- A specific number of decimal places.
- Include/not include leading zeros for fractional values.
- Show/not show parenthesis for negative values.
- Use/not use a group delimiter for the calculation as specified in Regional settings.
the easiest approach is to use the
FormatNumber() Function, as in:
- FormatNumber(6/2, 0, vbFalse, vbTrue, vbTrue)
OUTPUT: NOTE: Refer to the Help files for detailed information on this Function. Arguments 0,vbFalse,vbTrue, vbTrue coincide with items 1 through 4. The 1st Argument is simply the expression itself (6/2).