Java Float to Int floatToInt(String flot)

Here you can find the source of floatToInt(String flot)

Description

float To Int

License

Open Source License

Declaration

public static int floatToInt(String flot) 

Method Source Code

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

public class Main {
    public static int floatToInt(String flot) {
        float m;/* w w  w  .  j  ava 2s  . c  om*/
        try {
            m = Float.parseFloat(flot);
        } catch (Exception e) {
            return 0;
        }
        return (int) m;
    }

    public static int floatToInt(float flot) {
        return (int) flot;
    }
}

Related

  1. floatToInt(float f)
  2. floatToInt(float f, int defaultValue)
  3. floatToInt(float[] ints)
  4. floatToInt(float[] values)
  5. floatToInteger(final float value)
  6. floatToInteger(float f, float f2, float offset, boolean rotate)