The default Java Float.toString(float)
method prints a floating point number with "only as many ... [fractional] digits as are needed to uniquely distinguish the argument value from adjacent values of type float
." Perfect! Just what I need---except that I need to do this in a locale-specific way (e.g. on a French computer "1.23" would be represented as "1,23").
How do I reproduce the functionality of Float.toString(float)
in a locale-aware manner?