473,385 Members | 1,642 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

formatnumber is not taking thousands

I'm working on a proyect for a shopping cart, the problem is the coding is not taking the thousands in the sum for the grand total e.g.:

Sub total: 4,175.50
G.S.T.: 250.53
P.S.T: 334.04
Shipping: 8.95
Handling: 4.00
Grand Total:601.52
and it should be: 4,760.07

I've tried everything with the formatnumber, I want to know if there is a way to remove the comma for the thousands, or make the grand total to get the thousands format.

This is the parseFloat I have:

}

document.frmCart.shipping_cost.value = sngCurrShip.toFixed(2)
document.frmCart.shipping_show.value = (sngCurrShip - 4).toFixed(2)
document.frmCart.handling_show.value = (handleFee).toFixed(2)
sngGrandTot = parseFloat(document.frmCart.sngSubTotal.value) + parseFloat(document.frmCart.pst.value) + parseFloat(document.frmCart.gst.value) + parseFloat(document.frmCart.shipping_cost.value)
document.frmCart.GrandTotal.value = sngGrandTot.toFixed(2)
document.frmCart.charge_total.value = sngGrandTot.toFixed(2)
return ;
}

THANK YOU
Sep 26 '07 #1
2 1003
jhardman
3,406 Expert 2GB
moved to .NET forum
Sep 27 '07 #2
Plater
7,872 Expert 4TB
You are talking about when you do myfloat.ToString()?
There are overloads for .ToString() that will print it out with a thousands specifier.

If your trouble is with parsing a string into a float, float.Parse() has overloads as well that will allow a thousands specifier to be present.
Sep 27 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: eddie wang | last post by:
The following code with formatnumber function returns me the following code. Why? Thanks. <td align="right"><Font class=content4><%=formatNumber(ars.Fields("SOLD_AMOUNT"),2)%></td> Microsoft...
6
by: J. Baute | last post by:
I'm doing some tests to see if the Session.LCID can be used to easily change a user-dependant locale for number & date/time formatting in ASP. As far as I get the theory this should work, but I'm...
3
by: Greg | last post by:
I have a function for totalling decimal values provided in textboxes that form a column on a webpage. This script should total the values in the textboxes, displaying the result in the final...
4
by: Lakrom | last post by:
Hi to all this is a Data Base in SQL Server 2000 in page cartola.asp Good previously it asks for the date format where I only want the month in a consultation SQL and the solution is this:...
16
by: Douglas | last post by:
Gday, How would I format a number so that: TheValue = 32500 Displays in the TextBox as: $32,500.00
1
by: galsaba | last post by:
1. I want to have the value 01 if the number is 1 waht would be the function? 2. i think i need to use the function formatnumber. Where can I find on the web the syntex of cstr( ,...
3
by: fran | last post by:
Hi! I need to use a fucntion to format a number in c#, i have tried to use the FormatNumber function of vb.net, but the compiler doesn´t recognize it, Is there any similar function in c#??...
6
by: Gary Frank | last post by:
What are the ramifications if I were to instantiate an object tens of thousands of times and add them to an array? Or hundreds of thousands of times? Do you know if the act of instantiating a...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.