Convert Object -> Numeric
Posted: Sat Mar 02, 2019 11:36 am
I would write
Robert
PS In the next build you can also use the IS pattern
Robert
Code: Select all
if npgresult IS Decimal
nValue:= (int)npgresult // No need to try with Value property.
endif
PS In the next build you can also use the IS pattern
Code: Select all
IF npgResult is Decimal dValue
// now there is a local dValue of type Decimal with the value from npgResult
nValue := (INT) dValue // the compiler now knows that you are converting a decimal to an int
endif