The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> HTML/Java, Math Rounding to specified number of decimal places
stuart sanderson
post Apr 4 2007, 07:39 AM
Post #1





Group: Members
Posts: 1
Joined: 4-April 07
Member No.: 2,423



[font=Arial]
Dear Help Forum,
Can somebody please tell me the computer HTML (or Java) code for rounding a mathematical calculation to a specified number of decimal places:
e.g.,
- multiply 2.6 by 2.33 gives the answer 6.058. How do I round that to 2 decimal places - i.e., 6.06?
Thanks in advance,

Stuart Sanderson
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Effovex
post Apr 4 2007, 07:58 AM
Post #2


Serious Coder
*****

Group: Members
Posts: 251
Joined: 6-January 07
From: Sherbrooke, Qc, Canada
Member No.: 1,477



HTML can't do that. Java seems a bit heavy for this purpose. You're looking for JavaSCRIPT, which is entirely different from Java.

number rounding in javascript

Also, this belongs in the client-side scripting section, I believe. Certainly not in Feedback and Assistance, anyway.

This post has been edited by Effovex: Apr 4 2007, 08:02 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 26th April 2024 - 09:49 AM