Example usage for java.math BigDecimal BigDecimal

List of usage examples for java.math BigDecimal BigDecimal

Introduction

In this page you can find the example usage for java.math BigDecimal BigDecimal.

Prototype

public BigDecimal(char[] in, int offset, int len, MathContext mc) 

Source Link

Document

Translates a character array representation of a BigDecimal into a BigDecimal , accepting the same sequence of characters as the #BigDecimal(String) constructor, while allowing a sub-array to be specified and with rounding according to the context settings.

Usage

From source file:Main.java

public static void main(String[] args) {
    MathContext mc = new MathContext(3);
    char[] ch = new char[] { '1', '2', '3', '4', '5', '6', '7' };
    BigDecimal bg1 = new BigDecimal(ch, 2, 3, mc);
    System.out.println(bg1);/* w  w  w.ja va 2  s.c  om*/

}