uva2000grad
Programmer
I've run into a typing problem in vbscript ( imagin that)
I've got some values in a DB that I need to sum. They are BOTH Number types in Oracle. I have a function called DescNumber that converts NULLS to 0 and any other numbers it performs a Cdbl() on the variable.
The expression:
DescNumber ( Value1) + DescNumber( Value2 ) return 10 if value1 = 1 and value2 = 0 ie STRING concatenation!
but if it's written
DescNumber( Value1 + Value2 ) it returns 1.
What am I missing???? Thanks ahead of time.
I've got some values in a DB that I need to sum. They are BOTH Number types in Oracle. I have a function called DescNumber that converts NULLS to 0 and any other numbers it performs a Cdbl() on the variable.
The expression:
DescNumber ( Value1) + DescNumber( Value2 ) return 10 if value1 = 1 and value2 = 0 ie STRING concatenation!
but if it's written
DescNumber( Value1 + Value2 ) it returns 1.
What am I missing???? Thanks ahead of time.