For a Java application that drags data together from some sources and does some calculation itself, we want to offer users the possibility to use their own format strings, and would prefer the format string syntax they know from Excel (e. g. "$ "#,###.,0
) which happens to be the same used in .net and Analysis Services.
The closest thing to use that I found in Java is DecimalFormat which lacks some of the features (e. g. thousands and millions formatting by putting the thousands separator at the end, the floating point numbers NaN and infinity are displayed differently, etc., and probably depending on locale, there will be some additional small differences.
For now, just the numeric formatting would suffice. Maybe date and string formatting will become a requirement in future.
Is there a library, or would we have to develop that ourselves?
I cannot imagine we are the only ones who have this issue.
POI as suggested by Noel M does not seem to offer a solution. Any other ideas?