In Java, there is a way to get a format string from a Format object (or any derived classes)
In code:
Format f = new DecimalFormat("$0.00"); System.out.println(???);
Is it possible to use System.out.println (???); printable "$ 0.00".
I looked at Pattern (); but this function is not displayed in the abstract Format class, and the variable I'm working with may be something that extends the format.
The pattern (if one exists at all) depends on the subclass Format. There is no guarantee that I Formateven used a template to format it.
Format
: , , Format, Serializable.
, ! , , : - (
. Format (SimpleDateFormat, MessageFormat, ChoiceFormat, DecimalFormat); Pattern. , .
, , , , :
DecimalFormat f = new DecimalFormat("$0.00"); System.out.println(f.toPattern());
Source: https://habr.com/ru/post/1706340/More articles:MOSS 2007 site in farm type initializer exception - exceptionHow can I use the Groovy mock.interceptor package to model an object constructor? - mockingmultiple folders in App_Code folder - c #Understanding the Discrete Fourier Transform - mathReliable UDP - linuxPrefix / suffix for classes - c #How to imagine a path for a genetic algorithm? - language-agnosticModern and on demand - c #Reverse not found: context for sending request from templates - djangoItalic text in PropertyGrid - c #All Articles