Code example for BigDecimal

Methods: floatValue

0
        final BigDecimal percentage = BigDecimal.valueOf(this.mProgress).divide(BigDecimal.valueOf(this.mMax), 4,
                        RoundingMode.HALF_DOWN);
        final BigDecimal sweepAngle = percentage.multiply(BigDecimal.valueOf(360));
 
        // bounds are same as the bg circle, so diameter width and height moved in by margin 
        canvas.drawArc(this.mArcBounds, CircularProgressBar.ADJUST_FOR_12_OCLOCK, sweepAngle.floatValue(), false,
                        this.mProgressPaint);
 
        if (this.mShowText)
        { 
            if (this.mTextBounds == null)
            { 
                // Reference: http://stackoverflow.com/questions/3654321/measuring-text-height-to-be-drawn-on-canvas-android 
                // answer #2 
                this.mTextBounds = new Rect();
                this.mTextPaint.getTextBounds("0", 0, 1, this.mTextBounds); //$NON-NLS-1$
            } 
 
            // draw text in the center 
            canvas.drawText(String.valueOf(this.mProgress), center, center + (this.mTextBounds.height() >> 1),
                            this.mTextPaint);