diff --git a/Doc/Sd1/workingWithNumbers.xml b/Doc/Sd1/workingWithNumbers.xml index c8f2f2241a1072c453a096b2549b0757854b5501..b75024d005e81ddc4eb9c17816636933ff1dc4ab 100644 --- a/Doc/Sd1/workingWithNumbers.xml +++ b/Doc/Sd1/workingWithNumbers.xml @@ -592,9 +592,9 @@ Exception in thread "main" java.lang.NumberFormatException: locale-sensitive and uses the Locale to tailor information for the user.</para> - <para>For example, displaying a number is a locale-sensitive operation— - the number should be formatted according to the customs and conventions - of the user's native country, region, or culture.</para> + <para>For example, displaying a number is a locale-sensitive operation: + Numbers should be formatted according to the customs and conventions of + the user's native country, region, or culture.</para> </figure> <figure xml:id="sd1_numbers_fig_localeProperties"> @@ -626,14 +626,19 @@ Exception in thread "main" java.lang.NumberFormatException: xlink:href="https://docs.oracle.com/javase/10/docs/api/java/text/NumberFormat.html">NumberFormat</classname> instance</title> - <programlisting language="java">final NumberFormat standard = new DecimalFormat(); -System.out.println(standard.format(1234.5678)); + <informaltable border="0"> + <tr> + <td valign="top"><programlisting language="none">final NumberFormat standard = new DecimalFormat(); +System.out.println(standard.format(<emphasis role="red">1234.5678</emphasis>)); -final NumberFormat de = DecimalFormat.getInstance(Locale.GERMANY); -System.out.println(de.format(1234.5678));</programlisting> +final NumberFormat de = + DecimalFormat.getInstance(Locale.GERMANY); +System.out.println(de.format(<emphasis role="red">1234.5678</emphasis>));</programlisting></td> - <screen>1,234.568 -1.234,568</screen> + <td valign="top"><screen><emphasis role="red">1234.5678</emphasis> +<emphasis role="red">1.234,568</emphasis></screen></td> + </tr> + </informaltable> </figure> <figure xml:id="sd1_numbers_fig_customFormat"> @@ -641,8 +646,8 @@ System.out.println(de.format(1234.5678));</programlisting> <programlisting language="java">final DecimalFormatSymbols unusualSymbols = new DecimalFormatSymbols(Locale.getDefault()); -unusualSymbols.setDecimalSeparator('|'); -unusualSymbols.setGroupingSeparator('^'); +unusualSymbols.setDecimalSeparator(<emphasis role="red">'|'</emphasis>); +unusualSymbols.setGroupingSeparator(<emphasis role="red">'^'</emphasis>); final String strange = "#,##0.###"; final DecimalFormat weirdFormatter = new DecimalFormat(strange, unusualSymbols); @@ -650,7 +655,7 @@ weirdFormatter.setGroupingSize(4); System.out.println(weirdFormatter.format(12345.678));</programlisting> - <screen>1^2345|678</screen> + <screen>1<emphasis role="red">^</emphasis>2345<emphasis role="red">|</emphasis>678</screen> </figure> <qandaset defaultlabel="qanda"