public class FormulaFormatter extends Object implements Serializable
This is needed because internally POI only handles formulas with '.' as the decimal separator, and ',' as the argument separator.
| Modifier and Type | Class and Description |
|---|---|
protected class |
FormulaFormatter.NumberToken |
protected class |
FormulaFormatter.SeparatorToken |
| Constructor and Description |
|---|
FormulaFormatter() |
| Modifier and Type | Method and Description |
|---|---|
protected char |
getCurrentDecimalSeparator(Locale locale) |
protected DecimalFormat |
getDecimalFormat(Locale locale) |
boolean |
isFormulaFormat(String value) |
protected boolean |
isNumberChar(Character current,
Locale locale) |
boolean |
isValidFormulaFormat(String value,
Locale locale)
Rudimentary checks if the given string could be a valid formula
|
String |
reFormatFormulaValue(String formulaValue,
Locale locale)
Convert from a non-localized format to a localized.
|
protected List<com.vaadin.addon.spreadsheet.FormulaFormatter.FormulaToken> |
tokenizeFormula(String formulaValue,
Locale from) |
protected String |
tokensToString(List<com.vaadin.addon.spreadsheet.FormulaFormatter.FormulaToken> tokens) |
String |
unFormatFormulaValue(String formulaValue,
Locale locale)
Convert from a localized format to a non-localized.
|
protected List<com.vaadin.addon.spreadsheet.FormulaFormatter.FormulaToken> |
unLocalizeTokens(List<com.vaadin.addon.spreadsheet.FormulaFormatter.FormulaToken> tokens,
Locale locale) |
public String unFormatFormulaValue(String formulaValue, Locale locale)
formulaValue - the value that should be convertedlocale - the locale of the given valuepublic String reFormatFormulaValue(String formulaValue, Locale locale)
formulaValue - the value that should be convertedlocale - the target localepublic boolean isFormulaFormat(String value)
public boolean isValidFormulaFormat(String value, Locale locale)
value - whole formula as a string, must start with '=' or '+'locale - the current localeprotected String tokensToString(List<com.vaadin.addon.spreadsheet.FormulaFormatter.FormulaToken> tokens)
protected List<com.vaadin.addon.spreadsheet.FormulaFormatter.FormulaToken> unLocalizeTokens(List<com.vaadin.addon.spreadsheet.FormulaFormatter.FormulaToken> tokens, Locale locale)
protected List<com.vaadin.addon.spreadsheet.FormulaFormatter.FormulaToken> tokenizeFormula(String formulaValue, Locale from)
protected DecimalFormat getDecimalFormat(Locale locale)
protected char getCurrentDecimalSeparator(Locale locale)
Copyright © 2013–2026 Vaadin Ltd. All rights reserved.