Print currency.

@param value currency value
@return currency value
197067
public static final BigDecimal printCurrency(Number value)
   {
      return (value == null || value.doubleValue() == 0 ? null : new BigDecimal(value.doubleValue() * 100));
   }
1165865
public static String sqrt(String value) {
        try {
            BigDecimal bd = new BigDecimal(value);
            return Math.sqrt(bd.doubleValue()) + "";
        } catch (Exception ex) {
            return null;
        }
    }
547558
public static Double stringToScale(String value) {
		NumberFormat numberFormat = NumberFormat.getFormat("###,###");
		String[] scale2 = value.split(":");
		if (scale2.length == 1) {
			return 1.0 / numberFormat.parse(scale2[0].trim());
		} else {
			return numberFormat.parse(scale2[0].trim()) / numberFormat.parse(scale2[1].trim());
		}
	}
1073128
public function format($value)
    {
        $formatter = new NumberFormatter($this->locale(), NumberFormatter::CURRENCY);

        $code = $this->code($value);
        $divisor = $this->divisor($code);
        $amount = $this->convert($value, $divisor);

        return $formatter->formatCurrency($amount, $code);
    }
745902
public JBBPTextWriter Int(final int value) throws IOException {
    ensureValueMode();

    String convertedByExtras = null;
    for (final Extra e : this.extras) {
      convertedByExtras = e.doConvertIntToStr(this, value);
      if (convertedByExtras != null) {
        break;
      }
    }

    if (convertedByExtras == null) {
      final long valueToWrite;
      if (this.byteOrder == JBBPByteOrder.LITTLE_ENDIAN) {
        valueToWrite = JBBPUtils.reverseByteOrder(value, 4);
      } else {
        valueToWrite = value;
      }
      printValueString(JBBPUtils.ensureMinTextLength(JBBPUtils.ulong2str(valueToWrite & 0xFFFFFFFFL, this.radix, CHAR_BUFFER), this.maxCharsRadixForInt, '0', 0));
    } else {
      printValueString(convertedByExtras);
    }
    return this;
  }
1153922
protected String getHeaderValueText(Object value) {
        if (value == null) {
            return null;
        }

        // TODO: Type conversion based on provided config
        if (value.getClass() == String.class) {
            return (String) value;
        } else if (value instanceof List) {
            List<?> list = (List<?>) value;
            if (list.size() == 1) {
                return getHeaderValueText(list.get(0));
            } else {
                return list.toString();
            }
        }

        return null;
    }
273231
@Deprecated
	public ChainWriter printEU(String value) {
		int len = value.length();
		for (int c = 0; c < len; c++) {
			char ch = value.charAt(c);
			if (ch == ' ') out.print('+');
			else {
				if ((ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) out.print(ch);
				else {
					out.print('%');
					out.print(getHex(ch >>> 4));
					out.print(getHex(ch));
				}
			}
		}
		return this;
	}
433774
public static String getValueLabel(final Object value) {
        if (value == null) {
            return NULL_LABEL;
        }

        if (value instanceof HasLabelAdvice) {
            final String suggestedLabel = ((HasLabelAdvice) value).getSuggestedLabel();
            if (!Strings.isNullOrEmpty(suggestedLabel)) {
                return suggestedLabel;
            }
        }

        // format decimals
        if (value instanceof Double || value instanceof Float || value instanceof BigDecimal) {
            final NumberFormat format = NumberFormat.getNumberInstance();
            final String result = format.format((Number) value);
            logger.debug("Formatted decimal {} to: {}", value, result);
            return result;
        }

        // format dates
        if (value instanceof Date) {
            final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
            final String result = format.format((Date) value);
            logger.debug("Formatted date {} to: {}", value, result);
            return result;
        }

        return getLabel(value.toString());
    }
1020925
public function printMoneyFromValue($value)
    {
        $targetCurrency = $this
            ->currencyWrapper
            ->get();

        $money = Money::create(
            $value,
            $targetCurrency
        );

        return $this->printMoney($money);
    }
583003
public static final String printDate(Date value)
   {
      return (value == null ? null : DATE_FORMAT.get().format(value));
   }
756187
public String convertToLowerCase(String value) {
        String result = null;
        if (value != null) {
            result = value.toLowerCase();
        }
        return result;
    }
379675
public Double convertToDouble(String value) {
        Double result = null;
        if (value != null) {
            result = Double.valueOf(value);
        }
        return result;
    }
233691
public static String format(Object value) {
        if (value instanceof Byte)      return formatByte((Byte) value);
        if (value instanceof Short)     return formatShort((Short) value);
        if (value instanceof Long)      return formatLong((Long) value);
        if (value instanceof Float)     return formatFloat((Float) value);
        if (value instanceof Double)    return formatDouble((Double) value);
        if (value instanceof Character) return formatChar((Character) value);
        if (value instanceof String)    return formatString((String) value);
        if (value instanceof Integer ||
            value instanceof Boolean)   return value.toString();
        else
            throw new IllegalArgumentException("Argument is not a primitive type or a string; it " +
                                               ((value == null) ?
                                                "is a null value." :
                                                "has class " +
                                                value.getClass().getName()) + "." );
    }
13024
public static String formatCurrency(Object data, String currencyCode, Locale locale) {
        return formatCurrency(null, data, currencyCode, locale);
    }
263226
private static double convertStringToDouble(final String value) {
    double doubleValue = 0;
    if(!StringUtils.isBlank(value)) {
      try {
        doubleValue = Double.parseDouble(value.trim());
      }
      catch(Exception e) {
        // do nothing
      }
    }
    return doubleValue;
  }
178644
public static function currencyFormat($value, $currency = 'EUR', bool $withSymbol = true): string
    {
        $number = number_format((float) $value, 2, '.', ',');
        switch ($currency) {
            case 'EUR' : 
                return $number . ($withSymbol ? ' €' : '');
            case 'DOL' : 
                return ($withSymbol ? '$' : '') . $number;
            default : 
                return $number;
        }
    }
661633
public static function formatAsMoney($value, $currencySymbol = "&pound;", $roundToInteger = false) {
        if (is_numeric($value))
            return $currencySymbol . number_format($value, $roundToInteger ? 0 : 2, ".", "");
        else
            return null;
    }