All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.cucumber.cucumberexpressions.KeyboardFriendlyDecimalFormatSymbols Maven / Gradle / Ivy

Go to download

Cucumber Expressions are simple patterns for matching Step Definitions with Gherkin steps

There is a newer version: 18.0.1
Show newest version
package io.cucumber.cucumberexpressions;

import java.text.DecimalFormatSymbols;
import java.util.Locale;

/**
 * A set of localized decimal symbols that can be written on a regular keyboard.
 * 

* Note quite complete, feel free to make a suggestion. */ class KeyboardFriendlyDecimalFormatSymbols { static DecimalFormatSymbols getInstance(Locale locale) { DecimalFormatSymbols symbols = DecimalFormatSymbols.getInstance(locale); // Replace the minus sign with minus-hyphen as available on most keyboards. if (symbols.getMinusSign() == '\u2212') { symbols.setMinusSign('-'); } if (symbols.getDecimalSeparator() == '.') { // For locales that use the period as the decimal separator // always use the comma for thousands. The alternatives are // not available on a keyboard symbols.setGroupingSeparator(','); } else if (symbols.getDecimalSeparator() == ',') { // For locales that use the comma as the decimal separator // always use the period for thousands. The alternatives are // not available on a keyboard symbols.setGroupingSeparator('.'); } return symbols; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy