Forum Discussion

Jeff Garrison's avatar
Jeff Garrison
Copper Contributor
Jul 11, 2024

Formatting a Numbr in Forms and Reports

I've been trying to find something on this, but I'm continually running into dead ends.

 

On a form or report, I'd like to format a number so that it shows correctly.

 

The field is bound to a table, not a text field.

 

Take the number 1234.56 as entered into a field.  I would like for it to display 1,234.56.

 

If the number is 1234.5, I would like for it to display 1,234.5, not 1,234.50,

 

If the number is 1234, I would like for it to display 1,234, not 1,234.00.

 

So the format would need to adjust the decimal places as what is entered into the field.

 

Thanks in advance

 

Jeff

  • This format can't be archived by just changing a setting. The closest I got is "#,##0.##", with Decimals set to Auto.

  • ProcessIT's avatar
    ProcessIT
    Copper Contributor
    You can almost acheive this by using the Code #,###.## to the format field of the fields Properties box.
    The result will show the Decimal point but no trailing digits if none exist and 1 or 2 digits if they do exist.
    To fully remove the decimal point you would likely need to process it via a VBA function prior to saving, then display the saved data only.

Resources