public class NumericUtils extends Object
Copyright © 2022 xpc1024 All Rights Reserved
| 构造器和说明 |
|---|
NumericUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static double |
formatNumberWithOneDecimal(int number)
整数转double,保留1为小数 例如输入10,输出10.0
|
static double |
setDecimalPlaces(double origin,
int decimalPlaces)
设置保留小数位, 四舍五入
|
static float |
setDecimalPlaces(float origin,
int decimalPlaces)
设置保留小数位, 四舍五入
|
public static float setDecimalPlaces(float origin,
int decimalPlaces)
origin - 原始值decimalPlaces - 保留位数public static double setDecimalPlaces(double origin,
int decimalPlaces)
origin - 原始值decimalPlaces - 保留位数public static double formatNumberWithOneDecimal(int number)
number - 原始数值Copyright © 2024. All rights reserved.