New format for decimal values

A format for decimal values that can specify the max number of decimals, but will remove trailing zeros

fformat(123.45, 2) yields 123.45
fformat(123.45, 0) yields 123
fformat(123, 2) yields 123
fformat(123.4, 2) yields 123.4
fformat(123.45, 2) yields 123.45
fformat(123.456, 2) yields 123.46

Make this available in textboxes, and grids

I ask for this because the vast majority of our parts are sold and used in whole qty’s, so nearly every where a qty is shown there are trailing zeros.

In some reports a do a check to see if there is a fractional part, and format accordingly.
iif(floor(value,0)<>value, format(value,"0"), format(value,"0.00")
It would be nice if the UI could do that

Is this in SSRS? you are referring to?
Cause the SSRS Designer is ALL Microsoft, not much of anything Epicor can do there.

I can do it in SSRs with an expression (open to hearing better ways).

I was really referring to it in the Epicor UI, like:

And while that is a BAQ, I could convert it to text and stripp off the trailing zeros. But then it would be left aligned.

You should be able to do this with a custom Scalar-valued Function.

@hkeric.wci did a write up on these a while ago. [ Good or Bad ] BAQ - SQL Procedure / Function Helpers by Martin Horton

1 Like