-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
805 additions
and
411 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
Java/CesiumLanguageWriter/src/agi/foundation/compatibility/NumberFormatInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package agi.foundation.compatibility; | ||
|
||
import java.text.DecimalFormatSymbols; | ||
import java.util.Locale; | ||
|
||
/** | ||
* Defines how numeric values are formatted and displayed, depending on the culture. | ||
*/ | ||
public final class NumberFormatInfo { | ||
private final DecimalFormatSymbols decimalFormatSymbols; | ||
|
||
/** | ||
* Returns the NumberFormatInfo associated with the specified Locale. | ||
*/ | ||
public static NumberFormatInfo getInstance(Locale locale) { | ||
if (locale == null) | ||
locale = CultureInfoHelper.getCurrentCulture(); | ||
return new NumberFormatInfo(locale, DecimalFormatSymbols.getInstance(locale)); | ||
} | ||
|
||
/** | ||
* Gets the default read-only NumberFormatInfo that is culture-independent | ||
* (invariant). | ||
*/ | ||
public static NumberFormatInfo getInvariantInfo() { | ||
return getInstance(CultureInfoHelper.getInvariantCulture()); | ||
} | ||
|
||
private NumberFormatInfo(Locale locale, DecimalFormatSymbols decimalFormatSymbols) { | ||
this.decimalFormatSymbols = decimalFormatSymbols; | ||
} | ||
|
||
/** | ||
* Gets the string to use as the decimal separator in numeric values. | ||
*/ | ||
public String getNumberDecimalSeparator() { | ||
return String.valueOf(decimalFormatSymbols.getDecimalSeparator()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.