navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Free FrontPage Templates

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

rounding

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> rounding
Page: [1]
 
kitty6

 

Posts: 153
Joined: 10/15/2005
Status: offline

 
rounding - 8/31/2007 8:17:22   
The following code displays a value of $419.58

Response.write FormatCurrency( cLng(expmyob1) * (cLng(sale41002) / cLng(salestotal) ))

I then I create the variable: cpmyob1

<%cpmyob1 = FormatCurrency(cLng(expmyob1) * (cLng(sale41002) / cLng(salestotal) )) %>

The following code displays a value of $308.53

Response.write(FormatCurrency(FP_FieldVal(fp_rs,"myob2")*.10))

I then I create a second variable: cpmyob2

<%cpmyob2 = FormatCurrency((FP_FieldVal(fp_rs,"myob2")*.10)) %>

Here is my problem. The two values display properly but when add the two varibles together with the following code, it rounds it?

<% response.write FormatCurrency( cLng(cpmyob1) + cLng(cpmyob2)) %>

The total value should display $728.11 but now it displays $729.00? What am I doing wrong?

Thanks.
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: rounding - 8/31/2007 8:47:03   
Try changing 'clng()' to 'cbbl()' as in:

cDbl(cpmyob1)

Hope it helps.

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to kitty6)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> rounding
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts