Article View: borland.public.jbuilder.java.api
Article #740Re: How to calculate String(Expression) into Formula in servlets
From: John McGrath TeamB
Date: Wed, 04 Dec 2002 18:48
Date: Wed, 04 Dec 2002 18:48
25 lines
1714 bytes
1714 bytes
On Mon, 2 Dec 2002 09:42:36 +0800, Ashwin wrote:
> Anyone can help me how to calculate string(Expression) into formula.
>
> I am getting one Formula from Database as a String.
>
> That string like" x+2*y".
> I have the values of these x and y variables. But i am unable to
> pass these values into this formula and i am unable to split that
> formula also.
>
> Can anyone give the code i thankfull to them.
There is nothing in the standard Java classes for handling this.
However, if you search Google with "Java expression evaluator", you
will find plenty of packages that do.
--
Regards,
John McGrath [TeamB]
---------------------------------------------------
Before sending me e-mail, please read:
http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID:
<MPG.18581804ea049bd898bb91@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3deabaf2@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,18c8ab754dc8834e X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2002-12-04 11:09:50 PST From: John McGrath [TeamB] <ng-b@JPMcGrath.net> Newsgroups: borland.public.jbuilder.java.api Subject: Re: How to calculate String(Expression) into Formula in servlets Date: Wed, 4 Dec 2002 13:48:24 -0500 Message-ID: <MPG.18581804ea049bd898bb91@newsgroups.borland.com> References: <3deabaf2@newsgroups.borland.com> X-Newsreader: MicroPlanet Gravity v2.60 NNTP-Posting-Host: 151.197.228.67 X-Trace: newsgroups.borland.com 1039027703 151.197.228.67 (4 Dec 2002 10:48:23 -0800) Lines: 25 X-Authenticated-User: jpmcgrath Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail