Set character to use as the decimal mark. If the formatted value does not have any decimals, no decimal mark is
used either.
499153
public MonetaryFormat decimalMark(char decimalMark) {
        checkArgument(!Character.isDigit(decimalMark));
        checkArgument(decimalMark > 0);
        if (decimalMark == this.decimalMark)
            return this;
        else
            return new MonetaryFormat(negativeSign, positiveSign, zeroDigit, decimalMark, minDecimals, decimalGroups,
                    shift, roundingMode, codes, codeSeparator, codePrefixed);
    }
571722
def drop_trailing_zeros_decimal(num):
    
    out = str(num)
    return out.rstrip('0').rstrip('.') if '.' in out else out
298098
def format_value(self, value):
        
        if value == '' or value is None:
            return None
        return formats.localize_input(value, self.format)
695459
def set_digit(self, pos, digit, decimal=False):
        
        if self.invert:
            self.set_digit_raw(pos, IDIGIT_VALUES.get(str(digit).upper(), 0x00))
        else:
            self.set_digit_raw(pos, DIGIT_VALUES.get(str(digit).upper(), 0x00))

        if decimal:
            self.set_decimal(pos, True)
1123837
private void processCurrency(Row row)
   {
      String currencyName = row.getString("curr_short_name");
      DecimalFormatSymbols symbols = new DecimalFormatSymbols();
      symbols.setDecimalSeparator(row.getString("decimal_symbol").charAt(0));
      symbols.setGroupingSeparator(row.getString("digit_group_symbol").charAt(0));
      DecimalFormat nf = new DecimalFormat();
      nf.setDecimalFormatSymbols(symbols);
      nf.applyPattern("#.#");
      m_currencyMap.put(currencyName, nf);

      if (currencyName.equalsIgnoreCase(m_defaultCurrencyName))
      {
         m_numberFormat = nf;
         m_defaultCurrencyData = row;
      }
   }
1165684
@Override
  public void setDecimal(int ordinal, Decimal value, int precision) {
    assertIndexIsValid(ordinal);
    if (precision <= Decimal.MAX_LONG_DIGITS()) {
      // compact format
      if (value == null) {
        setNullAt(ordinal);
      } else {
        setLong(ordinal, value.toUnscaledLong());
      }
    } else {
      // fixed length
      long cursor = getLong(ordinal) >>> 32;
      assert cursor > 0 : "invalid cursor " + cursor;
      // zero-out the bytes
      Platform.putLong(baseObject, baseOffset + cursor, 0L);
      Platform.putLong(baseObject, baseOffset + cursor + 8, 0L);

      if (value == null) {
        setNullAt(ordinal);
        // keep the offset for future update
        Platform.putLong(baseObject, getFieldOffset(ordinal), cursor << 32);
      } else {

        final BigInteger integer = value.toJavaBigDecimal().unscaledValue();
        byte[] bytes = integer.toByteArray();
        assert(bytes.length <= 16);

        // Write the bytes to the variable length portion.
        Platform.copyMemory(
          bytes, Platform.BYTE_ARRAY_OFFSET, baseObject, baseOffset + cursor, bytes.length);
        setLong(ordinal, (cursor << 32) | ((long) bytes.length));
      }
    }
  }
829604
static String formatPriceString(double amount, @NonNull Currency currency) {
        double majorUnitAmount = amount / Math.pow(10, currency.getDefaultFractionDigits());
        NumberFormat currencyFormat = NumberFormat.getCurrencyInstance();
        try {
            DecimalFormatSymbols decimalFormatSymbols = ((java.text.DecimalFormat) currencyFormat)
                    .getDecimalFormatSymbols();
            decimalFormatSymbols.setCurrencySymbol(currency.getSymbol(Locale.getDefault()));
            ((java.text.DecimalFormat) currencyFormat)
                    .setDecimalFormatSymbols(decimalFormatSymbols);
            return currencyFormat.format(majorUnitAmount);
        } catch (ClassCastException e) {
            return currencyFormat.format(majorUnitAmount);
        }
    }
741491
def convert_value(self, value):
        
        if isinstance(value, str):
            assert value.startswith(self.symbol), "Currency does not start with " + self.symbol
            value = value.lstrip(self.symbol)
        return super().convert_value(value)
558798
def format_value(value):
    
    value = decimal.Decimal(str(value))
    if int(value) == value:
        return int(value)

    # On Python 3, an explicit cast to float is required
    return float(round(value, 1))
1345943
def _format_value(self, val):
        
        name = self.name + ":"
        if not self.multiline or "\n" not in val:
            val = u"{0} {1}".format(name.ljust(self._text_prefix_len), val)
        else:
            spacer = "\n" + " " * (self._text_prefix_len + 1)
            val = u"{0}{1}{2}".format(name, spacer, spacer.join(val.split("\n")))

        return val
1151200
def format_value(value,number_format):
    ""

    style,sufix,scale = decode_format(number_format)
    fmt = "{0:" + style + "}" + sufix

    return fmt.format(scale * value)
593507
def format_price(self, price):
        
        return u"{} {}{}{:02d}".format(
            self.get_currency_symbol(),
            price[0],
            self.get_decimal_mark(),
            price[1],
        )
872928
private void setupFormat(final ConditionNumberFormatter formatter) {

        if(formatter.containsSymbolTerm(Token.SYMBOL_SLASH)) {
            // 分数として処理する
            setupFormatAsFraction(formatter);
        } else {
            // 数値として処理する
            setupFormatAsDecimal(formatter);
        }

    }
532974
public static <T extends Number> String str(T x, DecimalFormat formatter) {
        if (Double.isNaN(x.doubleValue())) {
            return "nan";
        }
        if (Double.isInfinite(x.doubleValue())) {
            return isLt(x.doubleValue(), 0.0) ? "-inf" : "inf";
        }
        return formatter.format(x);
    }
1121375
def __set_amount(self, value):
        '''
        
        '''
        try:
            self.__amount = quantize(Decimal(str(value)))
        except:
            raise ValueError('Invalid amount value')
1174775
def _value_formatter(self, float_format=None, threshold=None):
        

        # the float_format parameter supersedes self.float_format
        if float_format is None:
            float_format = self.float_format

        # we are going to compose different functions, to first convert to
        # a string, then replace the decimal symbol, and finally chop according
        # to the threshold

        # when there is no float_format, we use str instead of '%g'
        # because str(0.0) = '0.0' while '%g' % 0.0 = '0'
        if float_format:
            def base_formatter(v):
                return float_format(value=v) if notna(v) else self.na_rep
        else:
            def base_formatter(v):
                return str(v) if notna(v) else self.na_rep

        if self.decimal != '.':
            def decimal_formatter(v):
                return base_formatter(v).replace('.', self.decimal, 1)
        else:
            decimal_formatter = base_formatter

        if threshold is None:
            return decimal_formatter

        def formatter(value):
            if notna(value):
                if abs(value) > threshold:
                    return decimal_formatter(value)
                else:
                    return decimal_formatter(0.0)
            else:
                return self.na_rep

        return formatter
107860
def decimal_format(value, TWOPLACES=Decimal(100) ** -2):
    ''
    if not isinstance(value, Decimal):
        value = Decimal(str(value))
    return value.quantize(TWOPLACES)