Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
$5 difference due to rounding?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01169448
Message ID:
01169663
Views:
14
>>scan
>> val = val+value calculated by formula
>>endscan
>>
>>replace myField with val (where myField is N(9,2))
>>
>>now I'm using
>>
>>scan
>> if category = 1
>> val1 = val1 + value calculated by formula
>> endif
>> if category = 2
>> val2 = val2 + value calculated by formula
>> endif
>>endscan
>>
>>replace Val1Field with val1, ... where the fields are of currency type.
>>
>>Now, the sum of va1+val2+... should be equal val
>>
>>It doesn't work for me.
>
>Naomi,
>try
>
>STORE 0 TO val
>scan
>   val = val+ROUND(value calculated by formula,2)
>endscan
>
>
>STORE 0 to val1,Val2
>
>scan
>  if category = 1
>  val1 = val1 + ROUND(value calculated by formula,2)
>  endif
>
>  if category = 2
>  val2 = val2 + ROUND(value calculated by formula,2)
>  endif
>endscan
>
>
>m.Val1 + m.val2 must by equal of m.val
>HTH

I'll try, though for the first I have no control, it's already pre-calculated.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform