本文整理了Java中com.github.mikephil.charting.utils.Utils.roundToNextSignificant()
方法的一些代码示例,展示了Utils.roundToNextSignificant()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.roundToNextSignificant()
方法的具体详情如下:
包路径:com.github.mikephil.charting.utils.Utils
类名称:Utils
方法名:roundToNextSignificant
[英]rounds the given number to the next significant number
[中]将给定的数字舍入到下一个有效数字
代码示例来源:origin: PhilJay/MPAndroidChart
/**
* Returns the appropriate number of decimals to be used for the provided
* number.
*
* @param number
* @return
*/
public static int getDecimals(float number) {
float i = roundToNextSignificant(number);
if (Float.isInfinite(i))
return 0;
return (int) Math.ceil(-Math.log10(i)) + 2;
}
代码示例来源:origin: PhilJay/MPAndroidChart
double interval = Utils.roundToNextSignificant(rawInterval);
double intervalMagnitude = Utils.roundToNextSignificant(Math.pow(10, (int) Math.log10(interval)));
int intervalSigDigit = (int) (interval / intervalMagnitude);
if (intervalSigDigit > 5) {
代码示例来源:origin: PhilJay/MPAndroidChart
double interval = Utils.roundToNextSignificant(rawInterval);
double intervalMagnitude = Utils.roundToNextSignificant(Math.pow(10, (int) Math.log10(interval)));
int intervalSigDigit = (int) (interval / intervalMagnitude);
if (intervalSigDigit > 5) {
代码示例来源:origin: xiaolongonly/Ticket-Analysis
/**
* Returns the appropriate number of decimals to be used for the provided
* number.
*
* @param number
* @return
*/
public static int getDecimals(float number) {
float i = roundToNextSignificant(number);
if (Float.isInfinite(i))
return 0;
return (int) Math.ceil(-Math.log10(i)) + 2;
}
代码示例来源:origin: com.github.PhilJay/MPAndroidChart
/**
* Returns the appropriate number of decimals to be used for the provided
* number.
*
* @param number
* @return
*/
public static int getDecimals(float number) {
float i = roundToNextSignificant(number);
if (Float.isInfinite(i))
return 0;
return (int) Math.ceil(-Math.log10(i)) + 2;
}
代码示例来源:origin: WenWangAndroid/ChartManager
/**
* Returns the appropriate number of decimals to be used for the provided
* number.
*
* @param number
* @return
*/
public static int getDecimals(float number) {
float i = roundToNextSignificant(number);
if (Float.isInfinite(i))
return 0;
return (int) Math.ceil(-Math.log10(i)) + 2;
}
代码示例来源:origin: WallaceXiao/StockChart-MPAndroidChart
/**
* Returns the appropriate number of decimals to be used for the provided
* number.
*
* @param number
* @return
*/
public static int getDecimals(float number) {
float i = roundToNextSignificant(number);
if (Float.isInfinite(i)) {
return 0;
}
return (int) Math.ceil(-Math.log10(i)) + 2;
}
代码示例来源:origin: com.github.PhilJay/MPAndroidChart
double interval = Utils.roundToNextSignificant(rawInterval);
double intervalMagnitude = Utils.roundToNextSignificant(Math.pow(10, (int) Math.log10(interval)));
int intervalSigDigit = (int) (interval / intervalMagnitude);
if (intervalSigDigit > 5) {
代码示例来源:origin: WallaceXiao/StockChart-MPAndroidChart
double interval = Utils.roundToNextSignificant(rawInterval);
double intervalMagnitude = Utils.roundToNextSignificant(Math.pow(10, (int) Math.log10(interval)));
int intervalSigDigit = (int) (interval / intervalMagnitude);
if (intervalSigDigit > 5) {
代码示例来源:origin: xiaolongonly/Ticket-Analysis
double interval = Utils.roundToNextSignificant(rawInterval);
double intervalMagnitude = Utils.roundToNextSignificant(Math.pow(10, (int) Math.log10(interval)));
int intervalSigDigit = (int) (interval / intervalMagnitude);
if (intervalSigDigit > 5) {
代码示例来源:origin: WenWangAndroid/ChartManager
double interval = Utils.roundToNextSignificant(rawInterval);
double intervalMagnitude = Utils.roundToNextSignificant(Math.pow(10, (int) Math.log10(interval)));
int intervalSigDigit = (int) (interval / intervalMagnitude);
if (intervalSigDigit > 5) {
代码示例来源:origin: WenWangAndroid/ChartManager
double interval = Utils.roundToNextSignificant(rawInterval);
double intervalMagnitude = Utils.roundToNextSignificant(Math.pow(10, (int) Math.log10(interval)));
int intervalSigDigit = (int) (interval / intervalMagnitude);
if (intervalSigDigit > 5) {
代码示例来源:origin: WallaceXiao/StockChart-MPAndroidChart
double interval = Utils.roundToNextSignificant(rawInterval);
double intervalMagnitude = Utils.roundToNextSignificant(Math.pow(10, (int) Math.log10(interval)));
int intervalSigDigit = (int) (interval / intervalMagnitude);
if (intervalSigDigit > 5) {
代码示例来源:origin: com.github.PhilJay/MPAndroidChart
double interval = Utils.roundToNextSignificant(rawInterval);
double intervalMagnitude = Utils.roundToNextSignificant(Math.pow(10, (int) Math.log10(interval)));
int intervalSigDigit = (int) (interval / intervalMagnitude);
if (intervalSigDigit > 5) {
代码示例来源:origin: xiaolongonly/Ticket-Analysis
double interval = Utils.roundToNextSignificant(rawInterval);
double intervalMagnitude = Utils.roundToNextSignificant(Math.pow(10, (int) Math.log10(interval)));
int intervalSigDigit = (int) (interval / intervalMagnitude);
if (intervalSigDigit > 5) {
内容来源于网络,如有侵权,请联系作者删除!