org.simpleods
public class CurrencyStyle extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
NUMBER_CURRENCY |
static int |
SYMBOLPOSITION_BEGIN |
static int |
SYMBOLPOSITION_END |
Constructor and Description |
---|
CurrencyStyle(java.lang.String sName,
int nMinIntDigits,
int nDecPlaces,
OdsFile odsFile)
Create a new number style with the name sName, minimum integer digits is nMinIntDigits
and decimal places is nDecPlaces.
|
CurrencyStyle(java.lang.String sName,
OdsFile odsFile)
Create a new number style with the name sName, default minimum integer digits is 1
and default decimal places is 2.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCountry() |
java.lang.String |
getCurrencySymbol() |
int |
getCurrencySymbolPosition()
Get the position of the currency symbol.
|
int |
getDecimalPlaces()
Get how many digits are to the right of the decimal symbol.
|
java.lang.String |
getLanguage() |
int |
getMinIntegerDigits()
Get how many leading zeros are present.
|
java.lang.String |
getName()
Get the name of this currency style.
|
java.lang.String |
getNegativeValueColor() |
boolean |
getThousandsSeparator() |
void |
setCountry(java.lang.String country)
Set the country and language if you need to distinguish between different countries.
|
void |
setCurrencySymbol(java.lang.String currencySymbol)
Change the currency symbol, e.g. '$'.
|
void |
setCurrencySymbolPosition(int nPos)
Set the position of the currency symbol, either CurrencyStyle.SYMBOLPOSITION_BEGIN or CurrencyStyle.SYMBOLPOSITION_END.
|
void |
setDecimalPlaces(int decimalPlaces)
Set how many digits are to the right of the decimal symbol.
|
void |
setLanguage(java.lang.String language)
Set the country and language if you need to distinguish between different
countries.
|
void |
setMinIntegerDigits(int minIntegerDigits)
Set how many leading zeros are present.
|
void |
setName(java.lang.String name)
Set the name of this style to sName.
|
void |
setNegativeValueColor(java.lang.String negativeValueColor) |
void |
setThousandsSeparator(boolean grouping)
If this is set to true, the thousands separator is shown.
|
java.lang.String |
toXML()
Write the XML format for this object.
|
public static final int NUMBER_CURRENCY
public static final int SYMBOLPOSITION_BEGIN
public static final int SYMBOLPOSITION_END
public CurrencyStyle(java.lang.String sName, OdsFile odsFile)
sName
- The name of the number style.odsFile
- The OdsFile to which this style belongspublic CurrencyStyle(java.lang.String sName, int nMinIntDigits, int nDecPlaces, OdsFile odsFile)
sName
- The name of the number style.nMinIntDigits
- The minimum integer digits to be shown.nDecPlaces
- The number of decimal places to be shown.odsFile
- The OdsFile to which this style belongspublic int getDecimalPlaces()
public void setDecimalPlaces(int decimalPlaces)
decimalPlaces
- - The number of digitspublic int getMinIntegerDigits()
public void setMinIntegerDigits(int minIntegerDigits)
minIntegerDigits
- The number of leading zerospublic boolean getThousandsSeparator()
public void setThousandsSeparator(boolean grouping)
grouping
- public java.lang.String getName()
public void setName(java.lang.String name)
name
- - The name of this stylepublic int getCurrencySymbolPosition()
public void setCurrencySymbolPosition(int nPos)
nPos
- public java.lang.String getNegativeValueColor()
public void setNegativeValueColor(java.lang.String negativeValueColor)
public java.lang.String getCurrencySymbol()
public void setCurrencySymbol(java.lang.String currencySymbol)
currencySymbol
- public java.lang.String getLanguage()
public void setLanguage(java.lang.String language)
language
- The two letter language code, e.g. 'en'public java.lang.String getCountry()
public void setCountry(java.lang.String country)
country
- The two letter country code, e.g. 'US'public java.lang.String toXML()