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 - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -