public class LcNum extends Object
Numeric picture patterns are used to parse and format numeric strings. Here are the metasymbols that form valid text picture patterns:
LcNum to reformat a text string
import com.adobe.xfa.ut.LcNum;
...
LcNum num = new LcNum("007", "en_US");
if (num.isValid())
String s = text.format(".999$");
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_PRECISION
An arbitrarily limited maximal decimal precision: 15.
|
static String |
NUMERIC_PICTURE_SYMBOLS
LcNum pattern symbols: (%$,.)89BCDERSVZbcdrsvzt.
|
| Constructor and Description |
|---|
LcNum(String text,
String locale)
Instantiates an LcNum object from the given text and in the locale given.
|
LcNum(String text,
String pic,
String locale)
Instantiates an LcNum object from the given text and pattern pattern
and in the locale given.
|
| Modifier and Type | Method and Description |
|---|---|
String |
format(String pat,
IntegerHolder radixPos)
Formats this LcNum object given a pattern string.
|
static void |
getSymbolCount(String pic,
IntegerHolder lead,
IntegerHolder frac)
Parse the picture and return the number of leading and fractional digits
the picture implies.
|
String |
getText()
Gets the parsed text.
|
double |
getValue()
Gets the parsed value.
|
boolean |
isValid()
Determines if this LcNum object is valid.
|
boolean |
parse(String sStr,
String pat)
Parses the given string according to the text pattern given.
|
public static final int MAX_PRECISION
public static final String NUMERIC_PICTURE_SYMBOLS
public LcNum(String text, String locale)
text - a text string.locale - a locale name. When empty, it will default
to the current locale.public String getText()
public double getValue()
public boolean isValid()
public String format(String pat, IntegerHolder radixPos)
pat - a pattern string.radixPos - the returned radix position within the formatted string
if specified.public boolean parse(String sStr, String pat)
sStr - the text string to parse.pat - a pattern string.public static void getSymbolCount(String pic, IntegerHolder lead, IntegerHolder frac)
pic - - a picture pattern string.lead - - the number of lead digits.frac - - the number of fractional digits.Copyright © 2010 - 2020 Adobe. All Rights Reserved