variable number of decimals

LabKey Support Forum (Inactive)
variable number of decimals jeckels  2010-11-05 10:33
Status: Closed
 
Hi Ben,

We don't have support for your specific scenario right now. Underneath, we're using java.text.DecimalFormat:

http://download.oracle.com/javase/6/docs/api/java/text/DecimalFormat.html

It doesn't have support for significant digits, and even if it did, this scenario is a tweak on the "usual" scenario of having a fixed number of significant digits.

I think your current choices are to use either 0.000 or 0.00#. The former will always include three decimal places, even for values that are > 1. The latter will omit the third decimal place for values < 1 if it's 0.

Supporting two different formats based on the value wouldn't be that difficult if this is worth prioritizing for a future release.

Thanks,
Josh