Important facts about commercial licenses

  • Licenses are perpetual. They do not expire and do not need to be renewed.
  • Licenses can be upgraded. You can upgrade to a more expensive license later paying only the difference in cost.
  • Pay attention to the distribution type - Hosted (sites / servers), binary (applications) or source (includes all the others). Choose according to your needs (more below).
  • All licenses allow commercial use unless otherwise indicated.
  • Read the full license by clicking on the icon.
  • Read more about licenses in our handy license guide.
$7

Modified Personal License

Unlimited projects Source and binary distribution
You need to log-in or create an account
  • Create an account
  • Log-in
  • Please use your real name.
  • Account activation link will be sent to this address.
  • Minimum 8 characters

Clicking this button confirms you read and agreed to the terms of use and privacy policy.

  • Released: May 28, 2011
    Last Update: May 27, 2011
  • Language: Java

String Math Expression Calculator

String Math Expression Calculator
Developed by Vit, Released May 28, 2011

Calculates string math expressions from user input or other sources. Includes calculator UI component for out of the box usefulness.

Java

Tags: calculator , expression , math , string calculation

Expression calculator

  • Ease to use: Calc.eval("(100+1)*(100-1)"); // returns 9999
  • Supported parentheses. For example:2*(5-3)
  • BigDecimal numbers. For example: 1000000000000000000000000+2000000000000000000000000 // One Septillion + Two Septillion
  • Simple ready-to-use UI component included (with full source code for customization):

simple calculator

Back to top

Sample

Use UI Component:

import com.programmisty.calc.*;

public class Sample1 {
    public static void main(String a[]) throws Exception {
       // Change UI Look And Feel (If needed)  //UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
        JFrame frame = new JFrame("Simple Calculator");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        // Important! ADD CALCULATOR PANEL
        frame.getContentPane().add(new CalculatorPanel());
        frame.pack();
        frame.setVisible(true);
    }
}

Use API :

import com.programmisty.calc.*;
import java.math.BigDecimal;
public class Sample2 {
    public static void main(String args[]) throws Exception {
           BigDecimal a = Calc.eval("100+100/5");
           double x = Calc.deval("100+100/4");
           int y = Calc.ieval("100+100/4");
    }
}

User Reviews

No reviews have been submitted yet.
Read all 1 comments »

Questions & Comments


Or enter your name and Email
  • Roedy Green 12 months ago
    This would be even more useful as a posted applet so you could use it without installing.
You must be logged-in to vote. Log-in to your account or register now.