473,466 Members | 1,370 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

dollarformat

document.test.form.itemprice.value = itemprice;
alert(itemprice);

If the value is 800.16, it keeps showing as 800.1600.
what will be the function to make this value as a money type?

Jul 23 '05 #1
6 2908
Check out the group FAQ:

<URL:http://jibbering.com/faq/#FAQ4_6>

Jul 23 '05 #2
Sorry, the URL was incomplete. Seems the new version of Firefox is a
bit different...

<URL:http://www.jibbering.com/faq/#FAQ4_6>

Jul 23 '05 #3
complex than what I thought. any simple function name to format it?
such as dollarformat(variables)

"RobG" <rg***@iinet.net.au> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Sorry, the URL was incomplete. Seems the new version of Firefox is a
bit different...

<URL:http://www.jibbering.com/faq/#FAQ4_6>

Jul 23 '05 #4
HandersonVA wrote on 10 mei 2005 in comp.lang.javascript:
"RobG" <rg***@iinet.net.au> wrote in message
Sorry, the URL was incomplete. Seems the new version of Firefox is a
bit different...

<URL:http://www.jibbering.com/faq/#FAQ4_6>

[please do not toppost on usenet]
complex than what I thought. any simple function name to format it?
such as dollarformat(variables)


As we don't all live in a dollar country,
I wouldn't pretend to know what you mean by "dollarformat".

v = 23.5;
document.write(euroformat(v)+'<br>');

v = -123;
document.write(euroformat(v)+'<br>');

function euroformat(x){
return "&euro;&nbsp;" + x.toFixed(2);
};

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 23 '05 #5
JRS: In article <Xn********************@194.109.133.29>, dated Tue, 10
May 2005 08:19:18, seen in news:comp.lang.javascript, Evertjan.
<ex**************@interxnl.net> posted :

function euroformat(x){
return "&euro;&nbsp;" + x.toFixed(2);
};


For browsers that implement &euro; and toFixed. And the FAQ says that
some toFixed is buggy.

€ gives a Euro sign on at least some systems that do not have
&euro; .

I wonder whether UniCode has a place reserved for the specifically-US
dollar? All sorts of people use \u0024; .

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 23 '05 #6
Dr John Stockton wrote on 10 mei 2005 in comp.lang.javascript:
I wonder whether UniCode has a place reserved for the specifically-US
dollar?
And what about the specifically-Canadian one?

And the British dollar? ;-\}
All sorts of people use \u0024; .


Not all, my sort does not, we use the &euro;
even though it is not an Uni[que]code

;-/}

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 23 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Alexio | last post by:
Am new to javascript. I need to format the currency in the as numbers are entered in textboxes. I can format the currency in the calculations and display in the totals but can not figure out how to...
1
by: RDpinoy | last post by:
Well anyways, trying to figure out how to properly trim out US currency. I want to take out the $ and the , comma so that I can have my calculation work properly and not to have an error message...
109
by: bonneylake | last post by:
Hey Everyone, Well i am having a problem outputting for my report and hoping someone can explain what i am doing wrong. What the report is about is comparing my company's part price's to d and...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.