Java Money fMoney(float pfNum)

Here you can find the source of fMoney(float pfNum)

Description

f Money

License

Apache License

Declaration

public static float fMoney(float pfNum) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static float fMoney(float pfNum) {
        float lfNum;

        if (pfNum >= 0f)
            lfNum = pfNum + .0025f;// www  .j ava  2  s.com
        else
            lfNum = pfNum - .0025f;

        return lfNum;
    }

    public static double fMoney(double pfNum) {
        double lfNum;

        // lfNum = (float)( ( 100 * pfNum ) + .5 ) /100 ;
        // lfNum = Math.rint(.5 + pfNum * 100.0)/100.0;
        if (pfNum >= 0f)
            lfNum = pfNum + .0025f;
        else
            lfNum = pfNum - .0025f;

        return lfNum;
    }
}

Related

  1. _getStrMoney(Object money)
  2. doubleToMoney(double value)
  3. GetMoneyAmount(int amount, int CheckAmount)
  4. isMoney(String money)
  5. isMoney(String money)
  6. isMoney(String str)