Java 12 new features | Compact Number Formatting in java JDK 12

Published: 02 October 2020
on channel: Java Beam
300
4

This video explains what is compact number formatting in java jdk 12.

What is compact number format: Compact number formatting refers to the representation of a number in a short or human readable form.

For example: in the en_US locale, 1000 can be formatted as "1K" and 1000000 can be formatted as "1M", depending upon the style specified by NumberFormat.Style.

The compact number formats are defined by LDML's specification for Compact Number Formats. To obtain an instance.

JDK API & Factory class:
NumberFormat adds support for formatting a number in its compact form.
Use one of the factory methods given by NumberFormat for compact

Number formatting. For example:
NumberFormat fmt = NumberFormat.getCompactNumberInstance(Locale.US, NumberFormat.Style.SHORT);
String result = fmt.format(1000);

LDML : Local Data Markup Language

#JavaBeam #JDK12NewFeatures #CompactNumberFormatInJava12 #Java #CompactNumberFormatInJava


On this page of the site you can watch the video online Java 12 new features | Compact Number Formatting in java JDK 12 with a duration of hours minute second in good quality, which was uploaded by the user Java Beam 02 October 2020, share the link with friends and acquaintances, this video has already been watched 300 times on youtube and it was liked by 4 viewers. Enjoy your viewing!