Package com.jk.core.util
Class ArabicDigits
java.lang.Object
com.jk.core.util.ArabicDigits
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic 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
formatDate
(Date date) 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
This main method is used for testing and demonstrating the class functionality.
-
Constructor Details
-
ArabicDigits
public ArabicDigits()
-
-
Method Details
-
format
This method formats a double number to Arabic representation.- Parameters:
num
- Specifies the number to format.- Returns:
- the formatted number in Arabic digits
-
format
This method formats a long number to Arabic representation.- Parameters:
num
- Specifies the number to format.- Returns:
- the formatted number in Arabic digits.
-
format
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
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
This method gets the current date and time formatted in Arabic script.- Returns:
- the current date and time formatted in Arabic.
-
main
This main method is used for testing and demonstrating the class functionality.- Parameters:
args
- the command-line arguments.
-