| Constructor |
| |
WUtil()
Initializes a newly created WUtil object.
|
| Methods |
| String |
CheckAmount(String Amount)
Formats the amount. [xxxxxx.xx -> xxxxxx.xx]
Parameters:
Amount - the amount to format.
Returns:
a String that represents the formated amount.
Example:
CheckAmount("1234.56"); // returns 1234.56
|
| String |
CheckAmountNoCent(String Amount)
Formats the amount. [xxxxxx.xx -> xxxxxx]
Parameters:
Amount - the amount to format.
Returns:
a String that represents the formated amount.
Example:
CheckAmountNoCent("1234.56"); // returns 1234
|
| String |
CheckAmountComma(String Amount)
Formats the amount. [xxxxxx.xx -> xxx,xxx.xx]
Parameters:
Amount - the amount to format.
Returns:
a String that represents the formated amount.
Example:
CheckAmountComma("1234.56"); // returns 1,234.56
|
| String |
CheckAmountCommaNoCent(String Amount)
Formats the amount. [xxxxxx.xx -> xxx,xxx]
Parameters:
Amount - the amount to format.
Returns:
a String that represents the formated amount.
Example:
CheckAmountCommaNoCent("1234.56"); // returns 1,234
|
| double |
GetAmount(String Amount)
Converts the amount from String to double.
Parameters:
Amount - the amount to convert.
Returns:
a double that represents the amount.
Example:
GetAmount("1234.56"); // returns 1234.56
|
| String |
SetAmount(double Amount)
Converts the amount from double to String.
Parameters:
Amount - the amount to convert.
Returns:
a String that represents the amount.
Example:
SetAmount(1234.567); // returns 1234.57
|
| String |
CheckDouble(String Value)
Checks and adjusts the value for correct double representation.
Parameters:
Value - the value to check.
Returns:
a String that represents the value.
|
| double |
GetDouble(String Value)
Converts the value from String to double.
Parameters:
Value - the value to convert.
Returns:
a double that represents the value.
|
| String |
SetDouble(double Value, int Precision)
Converts the value from double to String.
Parameters:
Value - the value to convert.
Precision - the precision [number of digits after decimal point].
Returns:
a String that represents the value.
|
| String |
CheckInt(String Value)
Checks and adjusts the value for correct int representation.
Parameters:
Value - the value to check.
Returns:
a String that represents the value.
|
| int |
GetInt(String Value)
Converts the value from String to int.
Parameters:
Value - the value to convert.
Returns:
an int that represents the value.
|
| String |
SetInt(int Value)
Converts the value from int to String.
Parameters:
Value - the value to convert.
Returns:
a String that represents the value.
|
| WDateTime |
GetDateTime(String DateTime)
Creates WDateTime object and initializes it.
Parameters:
DateTime - the value to initialize with.
Returns:
a WDateTime object.
|
| WDateTime |
GetLocalDateTime()
Creates WDateTime object and initializes it with local date and time.
Returns:
a WDateTime object.
|
| int |
CheckDay(int Day, int Month)
Checks and adjusts the day of the month.
Parameters:
Day - the day [1,2,...31].
Month - the month [1,2,...12].
Returns:
a day.
|
| String |
GetMonth(int Month)
Parameters:
Month - the month [1,2,...12].
Returns:
a String that represents the month name; an empty String if the month number is incorrect.
|
| String |
CheckStr(String Str)
Checks the string for all single quotes and produces a second single quote next to original for each one found.
This method is used for SQL INSERT and UPDATE.
Parameters:
Str - the string to check.
Returns:
a String with modified single quotes.
Example:
String str = "abc'123'xyz";
CheckStr(str); // returns abc''123''xyz
|
| String |
CheckStrHtml(String Str)
Checks the string for 0D0A, and produces <br> for each one found.
This method is used for showing a content of text file or database text field on a html page.
Parameters:
Str - the string to check.
Returns:
a String with modified single quotes.
Example:
String str = "abc 123";
CheckStrHtml(str); // returns abc<br>123
|
| Example |
| |
api_WUtil.java
|