Odd problem with calculation result
Posted: Fri Aug 24, 2018 1:53 am
We had an odd problem a while ago and I could not work out why it was occurring.
We have a field whose value allows an extra column to appear on a picklist. Originally this field held a single 3 digit integer, this being a numeric stock location code.
After a while, a 2nd stock location was needed to be shown. So it was decided, for simplicity, that we would change the numeric field to have 3 decimal places and the 2nd location would be held as the 'thousandth' value, ie .003 would return the code for a 2nd stock location of 3.
The below was therefore used to extract this 2nd location:
But we found that this simply did not work. It would often return a meaningless value, eg a 2 when the value should have been 3.
Changing the code that gets the 2nd stock branch to
worked.
But can anyone tell me why it did not work in the first place?
We have a field whose value allows an extra column to appear on a picklist. Originally this field held a single 3 digit integer, this being a numeric stock location code.
After a while, a 2nd stock location was needed to be shown. So it was decided, for simplicity, that we would change the numeric field to have 3 decimal places and the 2nd location would be held as the 'thousandth' value, ie .003 would return the code for a 2nd stock location of 3.
The below was therefore used to extract this 2nd location:
Code: Select all
int(100*(MY_CTRL->BROWSE_BR-int(MY_CTRL->BROWSE_BR)))
Changing the code that gets the 2nd stock branch to
Code: Select all
val(ntrim(100*(MY_CTRL->BROWSE_BR-int(MY_CTRL->BROWSE_BR))))
But can anyone tell me why it did not work in the first place?