Java Float Number Round round(float Rval, int Rpl)

Here you can find the source of round(float Rval, int Rpl)

Description

round

License

Open Source License

Declaration

public static float round(float Rval, int Rpl) 

Method Source Code

//package com.java2s;

public class Main {
    public static float round(float Rval, int Rpl) {
        float p = (float) Math.pow(10, Rpl);
        Rval = Rval * p;/*from w  w  w .  j  a v  a 2  s  . co  m*/
        float tmp = Math.round(Rval);
        return (float) tmp / p;
    }
}

Related

  1. round(float f, int n)
  2. round(float input)
  3. round(float input)
  4. round(float number, int fractionalPartSize)
  5. round(float pX)
  6. round(float Rval, int Rpl)
  7. round(float v)
  8. round(float val, int places)
  9. round(float value, float epsilon)