Java Integer Create toIntFormat(String value)

Here you can find the source of toIntFormat(String value)

Description

Convert from a String holding a double value of the form D.DDDDDDD into an Integer of the form : DDDDDDDD

License

Open Source License

Parameter

Parameter Description
value string holding a double value in the form D.DDDDDDD

Return

an Integer value in form DDDDDDDD

Declaration

static protected Integer toIntFormat(String value) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2006 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:/*from  w  w  w.j a v  a2s  . co  m*/
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

public class Main {
    /**
     * Convert from a String holding a double value of the form D.DDDDDDD into
     * an Integer of the form : DDDDDDDD
     * 
     * @param value
     *            string holding a double value in the form D.DDDDDDD
     * 
     * @return an Integer value in form DDDDDDDD
     */
    static protected Integer toIntFormat(String value) {
        Double dVal = Double.valueOf(value);
        return Integer.valueOf((int) (100000000.0 * dVal.doubleValue()));
    }
}

Related

  1. toInternalVariableName(String varName)
  2. toInternLink(String title, String url)
  3. toInterval(long i)
  4. toIntExact(long value)
  5. toIntExp(String charExp)
  6. toIntHeader(String value)
  7. toIntLE(byte[] value)
  8. toIntList(String valus)
  9. toIntMatrix(Number[][] matrix)