navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
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

Search Forums
 

Advanced search
Recent Posts

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

Microsoft MVP

 

It ignores Decimals!

 
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 >> It ignores Decimals!
Page: [1]
 
box

 

Posts: 117
Joined: 12/10/2002
Status: offline

 
It ignores Decimals! - 1/26/2008 2:12:22   
I dont know what to modify in order to accept decimal, the following it just ignores decimal! any idea pleae?

<%
MValue = (FP_Field(fp_rs,"yourpayment"))
MValue1 = (FP_Field(fp_rs,"yourcharges"))

If MValue1 = "" then MValue1 = 0
If MValue = "" then MValue = 0
MValue2 = cLng(MValue1)-MValue
%>
BeTheBall

 

Posts: 6336
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: It ignores Decimals! - 1/26/2008 14:50:07   
Use cDbl

<%
MValue = (FP_Field(fp_rs,"yourpayment"))
MValue1 = (FP_Field(fp_rs,"yourcharges"))

If MValue1 = "" then MValue1 = 0
If MValue = "" then MValue = 0
MValue2 = cDbl(MValue1)-MValue
%>

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to box)
box

 

Posts: 117
Joined: 12/10/2002
Status: offline

 
RE: It ignores Decimals! - 1/26/2008 16:58:40   
thanks for reply, but this function just round the number i want the exact number. if is 1.75 i want 1.75 not 2. any idea?

(in reply to BeTheBall)
BeTheBall

 

Posts: 6336
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: It ignores Decimals! - 1/26/2008 20:07:22   
You may want to look in the database and see how the numbers are being stored. Cdbl will not round which leads me to wonder what kind of numbers are coming out of the database.

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to box)
box

 

Posts: 117
Joined: 12/10/2002
Status: offline

 
RE: It ignores Decimals! - 1/26/2008 20:43:36   
I use Access and the type of data is long integer, and if i change it to decimal it gives me the following error:

Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch
/ep/user/detail_charge_pay.asp, line 151



(in reply to box)
ou812

 

Posts: 1538
Joined: 1/5/2002
From: San Diego
Status: offline

 
RE: It ignores Decimals! - 1/26/2008 22:18:35   
Does your data type of long integer have a decimal places set? Almost sounds like it is set to zero.

_____________________________

-brian

EnterpriseDB: Enterprise-class relational database management system
PostgreSQL: The world's most advanced open source database

(in reply to box)
box

 

Posts: 117
Joined: 12/10/2002
Status: offline

 
RE: It ignores Decimals! - 1/27/2008 0:27:38   
quote:

decimal places set


Is set to Auto!

(in reply to ou812)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> It ignores Decimals!
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