Resolved SQLITE Database and calculate

sigster

Member
Joined
Feb 7, 2010
Messages
12
Programming Experience
Beginner
Hi I have little problem with this

I am try to get 8.960

Percentage = NUMERIC / 4,48
Price = NUMERIC / 200.000
out = 8.960
I get 896

if I change Price to 200000 I get 896.000
if I change price to 2000 I get 8.960


VB.NET:
        Dim Price_keep As Double
        Dim Price_read As Double = reader("Price").ToString
        Price_keep = Price_read


        Dim Percentage_connect As Double = reader.GetDouble("Percentage").ToString
        Dim Percentage_read = String.Format("{0:n}", Percentage_connect)

        Dim Price_show = IIf(Double.Parse(Price_keep) = 0, System.DBNull.Value, Double.Parse(Price_keep))
        Dim Percentage_show = IIf(Double.Parse(Percentage_read) = 0, System.DBNull.Value, Double.Parse(Percentage_read))

        Dim Result As Double = Convert.ToDouble(Price_show) * Convert.ToDouble(Percentage_show)

Regards
Sigster
 
Finish to find it out = /100

VB.NET:
Dim Result As Double = Convert.ToDouble(Price_show) * Convert.ToDouble(Percentage_show /100)
 
Back
Top