@Nullable
  private static String _getTextValueForDecimalSeparator (@Nullable final String sTextValue,
                                                          @Nonnull final EDecimalSeparator eDecimalSep,
                                                          @Nonnull final EGroupingSeparator eGroupingSep)
  {
    ValueEnforcer.notNull (eDecimalSep, "DecimalSeparator");
    ValueEnforcer.notNull (eGroupingSep, "GroupingSeparator");

    final String ret = StringHelper.trim (sTextValue);

    // Replace only, if the desired decimal separator is not present
    if (ret != null && ret.indexOf (eDecimalSep.getChar ()) < 0)
      switch (eDecimalSep)
      {
        case COMMA:
        {
          // Decimal separator is a ","
          if (ret.indexOf ('.') > -1 && eGroupingSep.getChar () != '.')
          {
            // Currency expects "," but user passed "."
            return StringHelper.replaceAll (ret, '.', eDecimalSep.getChar ());
          }
          break;
        }
        case POINT:
        {
          // Decimal separator is a "."
          if (ret.indexOf (',') > -1 && eGroupingSep.getChar () != ',')
          {
            // Pattern contains no "," but value contains ","
            return StringHelper.replaceAll (ret, ',', eDecimalSep.getChar ());
          }
          break;
        }
        default:
          throw new IllegalStateException ("Unexpected decimal separator [" + eDecimalSep + "]");
      }
    return ret;
  }
@ Nullable private static String _getTextValueForDecimalSeparator ( @ Nullable final String sTextValue , @ Nonnull final EDecimalSeparator eDecimalSep , @ Nonnull final EGroupingSeparator eGroupingSep ) { ValueEnforcer . notNull ( eDecimalSep , "DecimalSeparator" ) ; ValueEnforcer . notNull ( eGroupingSep , "GroupingSeparator" ) ; final String ret = StringHelper . trim ( sTextValue ) ; if ( ret != null && ret . indexOf ( eDecimalSep . getChar ( ) ) < 0 ) switch ( eDecimalSep ) { case COMMA : { if ( ret . indexOf ( '.' ) > - 1 && eGroupingSep . getChar ( ) != '.' ) { return StringHelper . replaceAll ( ret , '.' , eDecimalSep . getChar ( ) ) ; } break ; } case POINT : { if ( ret . indexOf ( ',' ) > - 1 && eGroupingSep . getChar ( ) != ',' ) { return StringHelper . replaceAll ( ret , ',' , eDecimalSep . getChar ( ) ) ; } break ; } default : throw new IllegalStateException ( "Unexpected decimal separator [" + eDecimalSep + "]" ) ; } return ret ; }
Adopt the passed text value according to the requested decimal separator.

@param sTextValue
The text to be manipulated. May be <code>null</code>.
@param eDecimalSep
The decimal separator that is required. May not be <code>null</code>
.
@param eGroupingSep
The grouping separator that is required. May not be
<code>null</code> .
@return The manipulated text so that it matches the required decimal
separator or the original text