Package net.sf.saxon.expr.number
Class RegularGroupFormatter
java.lang.Object
net.sf.saxon.expr.number.NumericGroupFormatter
net.sf.saxon.expr.number.RegularGroupFormatter
A RegularGroupFormatter is a NumericGroupFormatter that inserts a separator
at constant intervals through a number: for example, a comma after every three
digits counting from the right.
-
Field Summary
Fields inherited from class net.sf.saxon.expr.number.NumericGroupFormatter
adjustedPicture
-
Constructor Summary
ConstructorsConstructorDescriptionRegularGroupFormatter
(int grpSize, String grpSep, UnicodeString adjustedPicture) Create a RegularGroupFormatter -
Method Summary
Modifier and TypeMethodDescriptionReformat a number to add grouping separatorsGet the grouping separator to be usedMethods inherited from class net.sf.saxon.expr.number.NumericGroupFormatter
getAdjustedPicture
-
Constructor Details
-
RegularGroupFormatter
Create a RegularGroupFormatter- Parameters:
grpSize
- the grouping size. If zero, no grouping separators are insertedgrpSep
- the grouping separator (normally but not necessarily a single character)adjustedPicture
- The picture, adjusted to conform to the rules of the xsl:number function, which means the picture supplied to format-integer minus any modifiers, and minus grouping separators and optional-digit signs
-
-
Method Details
-
format
Description copied from class:NumericGroupFormatter
Reformat a number to add grouping separators- Specified by:
format
in classNumericGroupFormatter
- Parameters:
value
- a buffer holding the number to be reformatted- Returns:
- the reformatted number
-
getSeparator
Get the grouping separator to be used- Specified by:
getSeparator
in classNumericGroupFormatter
- Returns:
- the grouping separator
-