It ignores Decimals! (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


box -> 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 -> 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
%>




box -> 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?




BeTheBall -> 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.




box -> 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






ou812 -> 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.




box -> RE: It ignores Decimals! (1/27/2008 0:27:38)

quote:

decimal places set


Is set to Auto!




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.046875