Class ArabicDigits

java.lang.Object
com.jk.core.util.ArabicDigits

public class ArabicDigits extends Object
This class is a utility class used to convert numbers and dates to their Arabic representation.

This class is designed to format numbers, dates, and digits in Arabic script.

This class is used by JasperReports to show the Arabic digits instead of English digits

Version:
1.0
Author:
Dr. Jalal H. Kiswani
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    format(double num)
    This method formats a double number to Arabic representation.
    static String
    format(long num)
    This method formats a long number to Arabic representation.
    static String
    This method formats a string containing numeric characters to Arabic representation.
    static String
    This method formats a date to a string representation in Arabic format.
    static String
    This method gets the current date and time formatted in Arabic script.
    static void
    main(String[] args)
    This main method is used for testing and demonstrating the class functionality.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ArabicDigits

      public ArabicDigits()
  • Method Details

    • format

      public static String format(double num)
      This method formats a double number to Arabic representation.
      Parameters:
      num - Specifies the number to format.
      Returns:
      the formatted number in Arabic digits
    • format

      public static String format(long num)
      This method formats a long number to Arabic representation.
      Parameters:
      num - Specifies the number to format.
      Returns:
      the formatted number in Arabic digits.
    • format

      public static String format(String str)
      This method formats a string containing numeric characters to Arabic representation.
      Parameters:
      str - Specifies the string to format.
      Returns:
      the formatted string with Arabic digits
    • formatDate

      public static String formatDate(Date date)
      This method formats a date to a string representation in Arabic format.
      Parameters:
      date - Specifies the date to format.
      Returns:
      the formatted date string in Arabic script.
    • getCurrentDateFormatted

      public static String getCurrentDateFormatted()
      This method gets the current date and time formatted in Arabic script.
      Returns:
      the current date and time formatted in Arabic.
    • main

      public static void main(String[] args)
      This main method is used for testing and demonstrating the class functionality.
      Parameters:
      args - the command-line arguments.