Java Number Minus minus(String second, String first)

Here you can find the source of minus(String second, String first)

Description

minus

License

Open Source License

Declaration

private static String minus(String second, String first) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    private static String minus(String second, String first) {
        try {//w w  w .  j  a v  a  2s  .  com
            return String.valueOf(Integer.parseInt(first) - Integer.parseInt(second));
        } catch (NumberFormatException e) {
            try {
                return String.valueOf(Double.parseDouble(first) - Double.parseDouble(second));
            } catch (NumberFormatException e2) {
                throw new IllegalArgumentException(first + " - " + second);
            }
        }
    }
}

Related

  1. minus(int flags, int set)
  2. minus(Integer a, Integer b)
  3. minus(Number n)
  4. minus(Number n)
  5. minus(String bigger, String smaller)
  6. minus128(int v)
  7. minuscula(char c)
  8. minusculas(char c)
  9. minusDayOfWeek(int dow, long days)