Java Money Format toMoney(long amount)

Here you can find the source of toMoney(long amount)

Description

to Money

License

Apache License

Declaration

public static String toMoney(long amount) 

Method Source Code

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

import java.text.DecimalFormat;

public class Main {
    public static String toMoney(long amount) {
        DecimalFormat df = new DecimalFormat("00");
        long bigPart = amount / 100;
        long smallPart = amount % 100;
        String result = String.format("%d.%s", bigPart,
                df.format(smallPart));//from www.j av  a2  s. co m
        return result;
    }
}

Related

  1. hourAndMinutesToString(int hours, int minutes)
  2. moneyDelFormat(String s)
  3. str2money(String str)
  4. toMemoryString(double bytes)
  5. toMemoryUnits(double value)