Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.text.NumberFormat;

public class Main {
    public static double String2AmountFloat(String str) {
        try {
            String tempStr = NumberFormat.getNumberInstance().format(Long.parseLong(str, 10)).replace(",", "");
            return Long.parseLong(tempStr) / 100.00;
        } catch (Exception e) {
            e.printStackTrace();
            return 0.00;
        }
    }
}