Parse a currency symbol position from a string representation.

@param value String representation
@return CurrencySymbolPosition instance
961520
public static final CurrencySymbolPosition parseCurrencySymbolPosition(String value)
   {
      CurrencySymbolPosition result = MAP_TO_CURRENCY_SYMBOL_POSITION.get(value);
      result = result == null ? CurrencySymbolPosition.BEFORE_WITH_SPACE : result;
      return result;
   }
321387
protected Key valueToKey(Value value) {
	if (value instanceof Resource) {
	    return pFactory.newKey(convertResourceToQualifiedName((Resource) value),
	                           name.PROV_QUALIFIED_NAME);
	} else if (value instanceof Literal) {
	    Literal lit=(Literal) value;
	    QualifiedName type;
	    QualifiedName xsdtype;
	    if (lit.getDatatype()!=null) {
		xsdtype= convertURIToQualifiedName(lit.getDatatype());
	    } else {
		xsdtype=name.PROV_LANG_STRING;
	    }
		    
	    Object o=decodeLiteral(lit);
	    if (o instanceof QualifiedName) {
		return pFactory.newKey(o, name.PROV_QUALIFIED_NAME);
	    }
	    // Was old code, relying on converter
	    //return pFactory.newKey(o, this.valueConverter.getXsdType(o));
	    return pFactory.newKey(o, xsdtype);

	} else if (value instanceof URI) {
	    URI uri = (URI) (value);
	    return pFactory.newKey(uri.toString(), name.PROV_QUALIFIED_NAME);
	} else if (value instanceof BNode) {
	    return pFactory.newKey(bnodeToQualifiedName((BNode)value), 
	                           name.PROV_QUALIFIED_NAME);
	} else {
	    return null;
	}
    }
1180581
@Override
    public Object convert(String value) {
        if (value == null || value.isEmpty()) {
            return value;
        }

        Object result = Ints.tryParse(value);

        if (result != null) {
            return result;
        }

        result = Longs.tryParse(value);

        if (result != null) {
            return result;
        }

        result = Doubles.tryParse(value);

        if (result != null) {
            return result;
        }

        return value;
    }
279413
public function reverseTransform($value): ?MoneyValue
    {
        if (null === $value || '' === $value) {
            return null;
        }

        if (!\is_string($value)) {
            throw new TransformationFailedException('Expected a string or null.');
        }

        $withCurrency = true;
        $result = $value;

        if (false !== mb_strpos($value, ' ')) {
            list($currency, $result) = explode(' ', $value, 2);

            if (mb_strlen($currency) !== 3) {
                throw new TransformationFailedException(
                    sprintf('Value does not contain a valid 3 character currency code, got "%s".', $currency)
                );
            }
        } else {
            $withCurrency = false;
            $currency = $this->defaultCurrency;
        }

        if (!$this->moneyParser) {
            $this->moneyParser = new DecimalMoneyParser(new ISOCurrencies());
        }

        try {
            return new MoneyValue($this->moneyParser->parse($result, $currency), $withCurrency);
        } catch (ParserException | UnknownCurrencyException $e) {
            throw new TransformationFailedException($e->getMessage(), 0, $e);
        }
    }
6567
public static Date parse(String value) {
        try {
            return STANDARD_DATE_FORMAT.get().parse(value);
        } catch (ParseException ignore) {
        }
        for (String formatString : BROWSER_COMPATIBLE_DATE_FORMATS) {
            try {
                return new SimpleDateFormat(formatString, Locale.US).parse(value);
            } catch (ParseException ignore) {
            }
        }
        return null;
    }
781262
def formatCurrency( value, options = nil )
      value ||= "0.00"
      if !value.include?( '.' )
         value << ".00"
      end
      
      currencySymbol = currencyFormat = nil
      if options
         currencySymbol = options["currencySymbol"]
         currencyFormat = options["currencyFormat"]
      end
      
      if currencySymbol
         if currencyFormat
            if currencyFormat == "0"
               value = "#{currencySymbol}#{value}"
            elsif currencyFormat == "1"
               if value.include?("-")
                  value.gsub!("-","-#{currencySymbol}")
               elsif value.include?("+")
                  value.gsub!("+","+#{currencySymbol}")
               else   
                  value = "#{currencySymbol}#{value}"
               end
            elsif currencyFormat == "2"
               value = "#{value}#{currencySymbol}"
            end
         else
            value = "#{currencySymbol}#{value}"
         end
      end
      
      value
   end
468546
public static final String printCurrencySymbolPosition(CurrencySymbolPosition value)
   {
      String result;

      switch (value)
      {
         default:
         case BEFORE:
         {
            result = "0";
            break;
         }

         case AFTER:
         {
            result = "1";
            break;
         }

         case BEFORE_WITH_SPACE:
         {
            result = "2";
            break;
         }

         case AFTER_WITH_SPACE:
         {
            result = "3";
            break;
         }
      }

      return (result);
   }
354758
private Charset getCharset(final String value) {
        Charset c = null;
        if (value != null) {
            final String[] tokens = value.trim().split("[;=]");
            if (tokens.length >= 3 && tokens[1].trim().equals("charset")) {
                try {
                    c = Charset.forName(tokens[2].trim());
                } catch (final RuntimeException e) {
                    logger.error(MessageUtils.getMessage("DOTJ052E", tokens[2].trim()).toString());
                }
            }
        }
        if (c == null) {
            final String defaultCharset = Configuration.configuration.get("default.coderef-charset");
            if (defaultCharset != null) {
                c = Charset.forName(defaultCharset);
            } else {
                c = Charset.defaultCharset();
            }
        }
        return c;
    }
719024
public static String getDigits(String value) {

    StringBuilder digits = new StringBuilder(value.length());

    for (char chr : value.toCharArray()) {
      if (Character.isDigit(chr)) {
        digits.append(chr);
      }
    }

    return digits.toString();
  }
1082802
private void parseCurrencies(List<String> content) throws Exception {
        for (String line : content) {
            Matcher matcher = CURRENCY_REGEX_LINE.matcher(line);
            if (matcher.matches()) {
                String currencyCode = matcher.group(1);
                int numericCode = Integer.parseInt(matcher.group(2));
                int digits = Integer.parseInt(matcher.group(3));
                registerCurrency(currencyCode, numericCode, digits);
            }
        }
    }
634988
function parseTransitionValue(values) {
  if (typeof values === 'string') values = values.trim().split(/\s*,\s*/g);
  var ret = [];

  for (var i = 0; i < values.length; i++) {
    var value = values[i].toString();

    if (value === 'initial') {
      value = 0;
    } else if (/ms$/.test(value)) {
      value = parseFloat(value) / 1000;
    } else {
      value = parseFloat(value);
    }

    ret.push(value);
  }

  return ret;
}
391916
function parseAnimationValue(value) {
  value = value.toString();

  if (value === 'initial') {
    value = 0;
  } else if (/ms$/.test(value)) {
    value = parseFloat(value);
  } else {
    value = parseFloat(value) * 1000;
  }

  return value;
}
825016
public static Number parseNumber( String value ) {
        // Try to parse as a number ...
        char c = value.charAt(0);

        if ((c >= '0' && c <= '9') || c == '.' || c == '-' || c == '+') {
            // It's definitely a number ...
            if (c == '0' && value.length() > 2) {
                // it might be a hex number that starts with '0x'
                char two = value.charAt(1);
                if (two == 'x' || two == 'X') {
                    try {
                        // Parse the remainder of the hex number ...
                        return Integer.parseInt(value.substring(2), 16);
                    } catch (NumberFormatException e) {
                        // Ignore and continue ...
                    }
                }
            }
            // Try parsing as a double ...
            try {
                if ((value.indexOf('.') > -1) || (value.indexOf('E') > -1) || (value.indexOf('e') > -1)) {
                    return Double.parseDouble(value);
                }
                Long longObj = new Long(value);
                long longValue = longObj.longValue();
                int intValue = longObj.intValue();
                if (longValue == intValue) {
                    // Then it's just an integer ...
                    return new Integer(intValue);
                }
                return longObj;
            } catch (NumberFormatException e) {
                // ignore ...
            }
        }
        return null;
    }
1106713
public static String substituteDecimalSeparatorToPeriod(String value)
	{
		if (StringUtil.isBlank(value))
		{
			return value;
		}

		int commaPosition = value.lastIndexOf(',');

		if (commaPosition == -1)
		{
			return value;
		}

		return value.substring(0, commaPosition) + "." +
			   value.substring(commaPosition + 1);
	}
825002
private static String formatValue(String value)
	{
		if(value == null)
			return "";
		
		value = value.trim();
		
		if(value.startsWith("\"")|| value.startsWith("'"))
			value = value.substring(1);
		
		if(value.endsWith("\"")|| value.endsWith("'"))
			value = value.substring(0, value.length() -1);
		
		return value;
	}
759306
@Pure
	@Inline(value = "EndianNumbers.parseBEInt(Float.floatToIntBits($1))",
			imported = {EndianNumbers.class})
	public static byte[] parseBEFloat(float value) {
		return parseBEInt(Float.floatToIntBits(value));
    }
243969
public void parseRawValue(String value)
   {
      int valueIndex = 0;
      int elementIndex = 0;
      m_elements.clear();
      while (valueIndex < value.length() && elementIndex < m_elements.size())
      {
         int elementLength = m_lengths.get(elementIndex).intValue();
         if (elementIndex > 0)
         {
            m_elements.add(m_separators.get(elementIndex - 1));
         }
         int endIndex = valueIndex + elementLength;
         if (endIndex > value.length())
         {
            endIndex = value.length();
         }
         String element = value.substring(valueIndex, endIndex);
         m_elements.add(element);
         valueIndex += elementLength;
         elementIndex++;
      }
   }