Percentages (Formatting)

RammerJammer1674

Registered User.
Local time
Yesterday, 23:01
Joined
Jan 2, 2013
Messages
18
Hi everyone,

I'm having problem calculating percentages. I have a Table that has fields for SystemPrice, PriceAdjust, PriceAdjustPercentage, and TotalPrice.

All are Currency except for PriceAdjustPercentage which obviously is a percentage and TotalPrice which is a calculated field.

TotalPrice is calculated as iif(not(isnull([PriceAdjust])),[SystemPrice]+[PriceAdjust],[SystemPrice]). It works perfectly fine the way I need it to work.

I have a form where you input the SystemPrice and either PriceAdjust OR PriceAdjustPercentage. If you enter PriceAdjust, OnUpdate will SetProperty PriceAdjustPercentage Value as =([TotalPrice]/[SystemPrice]-1). I know this is the correct formula to use, but it is giving me either 0.00%, 100.00%, 200.00% so on and so forth. It's not giving me the correct percentage. I believe it is a formatting issue. Also, if I type in directly to the PriceAdjustPercentage, it does the same thing. If I type in 25%, it rounds it down to 0.00%, 60% goes to 100.00% etc to the nearest 100.

Any help at all?
 
except for PriceAdjustPercentage which obviously is a percentage

Actually, its obviously not a percentage because there's no such thing as a percentage data type. What is the data type of PriceAdjustPercentage? What are some of the values in there? My guess is its some sort of integer which is why it is being rounded to the nearest integer (.25 -> 0, .60 - > 1, etc.)

Additionally, you shouldn't store calculated fields, which means TotalPrice shouldn't be a field. Neither should both PriceAdjust and PriceAdjustPercentage be fields, instead you should only store one of them and calculate the other.
 
check your datatype in the table is set to double or single number
 

Users who are viewing this thread

Back
Top Bottom