Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.math.BigDecimal;

public class Main {
    public static void main(String[] argv) throws Exception {
        int decimalPlaces = 2;
        BigDecimal bd = new BigDecimal("123456789.0123456890");

        bd = bd.setScale(decimalPlaces, BigDecimal.ROUND_DOWN);
        String string = bd.toString();
    }
}