java.util.Formatter.localizeDigits()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(133)

本文整理了Java中java.util.Formatter.localizeDigits()方法的一些代码示例,展示了Formatter.localizeDigits()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Formatter.localizeDigits()方法的具体详情如下:
包路径:java.util.Formatter
类名称:Formatter
方法名:localizeDigits

Formatter.localizeDigits介绍

[英]Returns a CharSequence corresponding to s with all the ASCII digits replaced by digits appropriate to this formatter's locale. Other characters remain unchanged.
[中]

代码示例

代码示例来源:origin: robovm/robovm

private void appendLocalized(StringBuilder result, long value, int width) {
  int paddingIndex = result.length();
  char zeroDigit = localeData.zeroDigit;
  if (zeroDigit == '0') {
    result.append(value);
  } else {
    result.append(localizeDigits(Long.toString(value)));
  }
  int zeroCount = width - (result.length() - paddingIndex);
  if (zeroCount <= 0) {
    return;
  }
  if (zeroDigit == '0') {
    result.insert(paddingIndex, ZEROS, 0, zeroCount);
  } else {
    for (int i = 0; i < zeroCount; ++i) {
      result.insert(paddingIndex, zeroDigit);
    }
  }
}

代码示例来源:origin: robovm/robovm

digits = localizeDigits(digits);

代码示例来源:origin: robovm/robovm

return needLocalizedDigits ? localizeDigits(result) : result;

代码示例来源:origin: MobiVM/robovm

private void appendLocalized(StringBuilder result, long value, int width) {
  int paddingIndex = result.length();
  char zeroDigit = localeData.zeroDigit;
  if (zeroDigit == '0') {
    result.append(value);
  } else {
    result.append(localizeDigits(Long.toString(value)));
  }
  int zeroCount = width - (result.length() - paddingIndex);
  if (zeroCount <= 0) {
    return;
  }
  if (zeroDigit == '0') {
    result.insert(paddingIndex, ZEROS, 0, zeroCount);
  } else {
    for (int i = 0; i < zeroCount; ++i) {
      result.insert(paddingIndex, zeroDigit);
    }
  }
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

private void appendLocalized(StringBuilder result, long value, int width) {
  int paddingIndex = result.length();
  char zeroDigit = localeData.zeroDigit;
  if (zeroDigit == '0') {
    result.append(value);
  } else {
    result.append(localizeDigits(Long.toString(value)));
  }
  int zeroCount = width - (result.length() - paddingIndex);
  if (zeroCount <= 0) {
    return;
  }
  if (zeroDigit == '0') {
    result.insert(paddingIndex, ZEROS, 0, zeroCount);
  } else {
    for (int i = 0; i < zeroCount; ++i) {
      result.insert(paddingIndex, zeroDigit);
    }
  }
}

代码示例来源:origin: com.bugvm/bugvm-rt

private void appendLocalized(StringBuilder result, long value, int width) {
  int paddingIndex = result.length();
  char zeroDigit = localeData.zeroDigit;
  if (zeroDigit == '0') {
    result.append(value);
  } else {
    result.append(localizeDigits(Long.toString(value)));
  }
  int zeroCount = width - (result.length() - paddingIndex);
  if (zeroCount <= 0) {
    return;
  }
  if (zeroDigit == '0') {
    result.insert(paddingIndex, ZEROS, 0, zeroCount);
  } else {
    for (int i = 0; i < zeroCount; ++i) {
      result.insert(paddingIndex, zeroDigit);
    }
  }
}

代码示例来源:origin: ibinti/bugvm

private void appendLocalized(StringBuilder result, long value, int width) {
  int paddingIndex = result.length();
  char zeroDigit = localeData.zeroDigit;
  if (zeroDigit == '0') {
    result.append(value);
  } else {
    result.append(localizeDigits(Long.toString(value)));
  }
  int zeroCount = width - (result.length() - paddingIndex);
  if (zeroCount <= 0) {
    return;
  }
  if (zeroDigit == '0') {
    result.insert(paddingIndex, ZEROS, 0, zeroCount);
  } else {
    for (int i = 0; i < zeroCount; ++i) {
      result.insert(paddingIndex, zeroDigit);
    }
  }
}

代码示例来源:origin: com.gluonhq/robovm-rt

private void appendLocalized(StringBuilder result, long value, int width) {
  int paddingIndex = result.length();
  char zeroDigit = localeData.zeroDigit;
  if (zeroDigit == '0') {
    result.append(value);
  } else {
    result.append(localizeDigits(Long.toString(value)));
  }
  int zeroCount = width - (result.length() - paddingIndex);
  if (zeroCount <= 0) {
    return;
  }
  if (zeroDigit == '0') {
    result.insert(paddingIndex, ZEROS, 0, zeroCount);
  } else {
    for (int i = 0; i < zeroCount; ++i) {
      result.insert(paddingIndex, zeroDigit);
    }
  }
}

代码示例来源:origin: FlexoVM/flexovm

private void appendLocalized(StringBuilder result, long value, int width) {
  int paddingIndex = result.length();
  char zeroDigit = localeData.zeroDigit;
  if (zeroDigit == '0') {
    result.append(value);
  } else {
    result.append(localizeDigits(Long.toString(value)));
  }
  int zeroCount = width - (result.length() - paddingIndex);
  if (zeroCount <= 0) {
    return;
  }
  if (zeroDigit == '0') {
    result.insert(paddingIndex, ZEROS, 0, zeroCount);
  } else {
    for (int i = 0; i < zeroCount; ++i) {
      result.insert(paddingIndex, zeroDigit);
    }
  }
}

代码示例来源:origin: MobiVM/robovm

digits = localizeDigits(digits);

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

digits = localizeDigits(digits);

代码示例来源:origin: ibinti/bugvm

digits = localizeDigits(digits);

代码示例来源:origin: com.bugvm/bugvm-rt

digits = localizeDigits(digits);

代码示例来源:origin: com.gluonhq/robovm-rt

digits = localizeDigits(digits);

代码示例来源:origin: ibinti/bugvm

return needLocalizedDigits ? localizeDigits(result) : result;

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

return needLocalizedDigits ? localizeDigits(result) : result;

代码示例来源:origin: com.bugvm/bugvm-rt

return needLocalizedDigits ? localizeDigits(result) : result;

代码示例来源:origin: com.gluonhq/robovm-rt

return needLocalizedDigits ? localizeDigits(result) : result;

代码示例来源:origin: MobiVM/robovm

return needLocalizedDigits ? localizeDigits(result) : result;

代码示例来源:origin: FlexoVM/flexovm

return needLocalizedDigits ? localizeDigits(result) : result;

相关文章