format int As Currency - Java java.lang

Java examples for java.lang:double Format

Description

format int As Currency

Demo Code


//package com.java2s;
import java.text.NumberFormat;

public class Main {
    public static String formatAsCurrency(int amount) {
        return NumberFormat.getCurrencyInstance().format(amount / 100.00);
    }//from  w  w  w  .  j av a2 s  .  co m
}

Related Tutorials