I know that fps is "decimal" like ratings and in the forums I found some postings on rounding to various decimal places but nothing on how to truncate the decimal places when it is a whole number.
For example, I'm okay with 23.976, but if the fps is a whole number like 25.000 I would prefer that it show as just 25.
Thanks
J
Truncate decimals for fps when a whole number
Re: Truncate decimals for fps when a whole number
Try BigDecimal.stripTrailingZeros() like so:
Code: Select all
{fps.stripTrailingZeros()}
Re: Truncate decimals for fps when a whole number
{fps.stripTrailingZeros()} does not work perfectly because 20 becomes 2E+1, 30 becomes 3E+1 and so forth. Does not work well for multiples of 10.
Had to do some Java research and adding .toPlainString() will fix this so that 20 stays as 20 and so forth, in case anyone else is interested.
{fps.stripTrailingZeros().toPlainString()'}
Had to do some Java research and adding .toPlainString() will fix this so that 20 stays as 20 and so forth, in case anyone else is interested.
{fps.stripTrailingZeros().toPlainString()'}
Re: Truncate decimals for fps when a whole number
I see. That's problematic. I'll make sure not to use stripTrailingZeros() implicitly for built-in bindings then.