Java Language Basics Number Format

Java examples for Language Basics:Number Format

Description

Click the following links for the tutorial for Language Basics and Number Format.

  1. Formatting Numbers Using Default Formats
  2. Using C's Printf-style Formatting in Java
  3. Implementing a Custom Formatter Using the Formattable Interface
  4. Using the integer conversion characters.
  5. Using floating-point conversion characters.
  6. Using character and string conversion characters.
  7. Formatting dates and times with conversion characters t and T.
  8. Using the b, B, h, H, % and n conversion characters.


  9. Right justifying integers in fields.
  10. Using precision for floating-point numbers and strings.
  11. Right justifying and left justifying values
  12. Printing numbers with and without the + flag.
  13. Printing a space before non-negative values.
  14. Using the # flag with conversion characters o and x.
  15. Printing with the 0 (zero) flag fills in leading zeros.
  16. Using the comma (,) flag to display numbers with thousands separator.


  17. Using the (flag to place parentheses around negative numbers.
  18. Reordering output with argument indices.
  19. Formatting output with class Formatter.
  20. Format float point value with System.out.format method
  21. Format data type for boolean, char, String, int, long and double
  22. Format more than one value in System.out.format
  23. Number format for various Locale
  24. Format number with Thai Locale
  25. Format number with custom format ###,###.##
  26. Format double value with custom format $###,###.###
  27. Format double type value
  28. Format Calendar type value
  29. Uses the percentage format
  30. Formats a number using the general number format with exactly three decimal places:
  31. Formatting Numbers with NumberFormat class
  32. Formatting Numbers, align right, with decimal