Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static int convertDOubleToInt(Double value) {
        String valueString = Double.toString(value);

        for (int i = 0; i < valueString.length(); i++) {
            if (valueString.charAt(i) == '.') {
                valueString = valueString.substring(0, i);
                break;
            }
        }

        int valueInteger = Integer.parseInt(valueString);

        return valueInteger;
    }
}