floating point - Equivalent of %g in java.text.DecimalFormat? -


i'm using freemarker uses java.text.decimalformat numeric formatting. i'm used sprintf()-style formatting, , lot of times use %g chooses shorter of %f or %e formatting.

is there way equivalent using java.text.decimalformat?

the straight-up answer question not. not without formatting in both formats , comparing length hand , outputting 1 better.

is there possibility use java.util.formatter instead? %g , sprintf() formats.


Comments

Popular posts from this blog

android - How to save instance state of selected radiobutton on menu -

python 3 IndexError: list index out of range -

IF statement in MySQL trigger -