Here you can find the source of toCurrencyAmountStr(Long microAmount)
Parameter | Description |
---|---|
microAmount | the micro amount value |
public static String toCurrencyAmountStr(Long microAmount)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import java.text.DecimalFormat; public class Main { private static final long MICRO_MULTIPLIER = 1000000; private static final DecimalFormat df = new DecimalFormat("0.##"); /**/*w w w. j a v a 2 s . c om*/ * Converts micro amount to currency amount. * * @param microAmount the micro amount value */ public static String toCurrencyAmountStr(Long microAmount) { double normalAmount = (double) microAmount / MICRO_MULTIPLIER; return df.format(normalAmount); } }