get Integer Count - Android java.lang

Android examples for java.lang:Math

Description

get Integer Count

Demo Code


//package com.java2s;

import java.math.BigDecimal;

public class Main {
    public static int getIntegerCount(BigDecimal value) {
        int absIntValue = value.abs().intValue();
        return absIntValue > 0 ? String.valueOf(absIntValue).length() : 0;
    }//from  w  w  w.j  a v  a 2s  . c om
}

Related Tutorials