public class PlusCToolKitTOCommon
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
MAXFRACTION |
Constructor and Description |
---|
PlusCToolKitTOCommon() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
convertNumberToRightLocale(java.lang.String number,
java.util.Locale locale)
NOTE: This method was copied from PlusCFldToleranceUpdate
|
static java.lang.String |
formatDouble(java.lang.String value,
int minFraction,
java.util.Locale locale,
boolean shouldRound)
Formats the given value so that it has the given number of decimal places.
|
static java.lang.String |
formatDouble(java.lang.String s,
java.util.Locale locale)
Formats the given value with the default number format for the locale.
|
static java.lang.String |
formatDouble(java.lang.String fieldName,
java.lang.String value,
int minFraction,
java.util.Locale locale)
Issue 07-24146
Method signature was changed because sometimes the
fieldName is relevant
|
static java.lang.String |
formatDoubleMax(java.lang.String value,
int maxFraction,
java.util.Locale locale)
Formats the given value so that it has at least the given number of decimal places.
|
static java.lang.String |
formatDoubleMax(java.lang.String value,
int maxFraction,
java.util.Locale locale,
boolean checkRoundUp,
boolean shouldRound)
Formats the given value so that it has the given number of decimal places.
|
static java.lang.String |
formatDoubleMax(java.lang.String fieldName,
java.lang.String value,
int maxFraction,
java.util.Locale locale,
boolean checkRoundUp)
Issue 07-24146
Method signature was changed because sometimes the
fieldName is relevant
|
static java.lang.String |
formatDoubleMinMax(java.lang.String value,
int minFraction,
int maxFraction,
java.util.Locale locale) |
static java.lang.String |
formatNumberWithMinPrecision(java.lang.String value,
int minFraction,
java.util.Locale locale,
boolean shouldRound)
Formats the given value so that it has at least the given number of
decimal places.
|
static int |
getDecimalDigits(java.lang.String s) |
static double |
getDouble(java.lang.String s,
java.util.Locale locale) |
static boolean |
isValidNumber(java.lang.String value,
java.util.Locale userLocale)
Checks whether the given value is a valid number in one of the following locales:
- The given user locale
- US locale (separator: ".")
- Italian locale (separator: ",")
|
static boolean |
isValidNumberInLocale(java.lang.String value,
java.util.Locale locale)
Checks whether the given value is valid number in the given locale.
|
static java.lang.String |
replace(java.lang.String original,
java.lang.String pattern,
java.lang.String replace)
As jdk 1.3 does not have String.replaceAll() this method was created to
implement a replace using strings instead of chars.
|
static java.lang.String[] |
split(java.lang.String splitString,
java.lang.String splitToken)
Replaces the split method from java.lang.String in java 1.4 It was
created due to an issue with the CDC Mobile implementation that is
currently on java 1.3 When CDC based on java 1.4 is released this method
can be replaced by String.split()
|
static double |
stringToDouble(java.lang.String s,
java.util.Locale l)
convert a double to string using the specified locale NOTE: Copied from
MXFormat
|
static double |
strToDbl(java.lang.String a) |
public static final int MAXFRACTION
public static double getDouble(java.lang.String s, java.util.Locale locale)
public static double stringToDouble(java.lang.String s, java.util.Locale l)
public static java.lang.String convertNumberToRightLocale(java.lang.String number, java.util.Locale locale)
public static java.lang.String formatNumberWithMinPrecision(java.lang.String value, int minFraction, java.util.Locale locale, boolean shouldRound)
value
- value to be formattedminFraction
- minimum number of decimal placeslocale
- Locale to useshouldRound
- whether it should be rounded or truncatedpublic static java.lang.String formatDouble(java.lang.String value, int minFraction, java.util.Locale locale, boolean shouldRound)
value
- minFraction
- locale
- shouldRound
- public static java.lang.String formatDouble(java.lang.String fieldName, java.lang.String value, int minFraction, java.util.Locale locale)
public static java.lang.String formatDoubleMax(java.lang.String fieldName, java.lang.String value, int maxFraction, java.util.Locale locale, boolean checkRoundUp)
public static java.lang.String formatDoubleMax(java.lang.String value, int maxFraction, java.util.Locale locale, boolean checkRoundUp, boolean shouldRound)
value
- the value to be formattedmaxFraction
- the number of decimal placeslocale
- locale to use for parsing and formattingcheckRoundUp
- shouldRound
- public static java.lang.String formatDoubleMax(java.lang.String value, int maxFraction, java.util.Locale locale)
value
- the value to be formattedmaxFraction
- the maximum number of decimal placeslocale
- locale to use for parsing and formattingpublic static java.lang.String formatDoubleMinMax(java.lang.String value, int minFraction, int maxFraction, java.util.Locale locale)
public static double strToDbl(java.lang.String a)
public static int getDecimalDigits(java.lang.String s)
s
- public static java.lang.String formatDouble(java.lang.String s, java.util.Locale locale)
s
- value to be formattedlocale
- localepublic static java.lang.String[] split(java.lang.String splitString, java.lang.String splitToken)
value
- splitChar
- psdi.webclient.beans.report.ReportDialogBean.splitString(String
splitString, String splitToken);
public static java.lang.String replace(java.lang.String original, java.lang.String pattern, java.lang.String replace)
original
- pattern
- replace
- public static boolean isValidNumber(java.lang.String value, java.util.Locale userLocale)
value
- the value to validateuserLocale
- the user's localepublic static boolean isValidNumberInLocale(java.lang.String value, java.util.Locale locale)
value
- the value to validatelocale
- the locale used to interpret the valuetrue
if it is a valid number, false othewise