C
CMI
Guest
Could it be possible for the INTEGER & DECIMAL ABL functions to be improved so that they could handle E-Notation Currently I'm importing data from MS Excel where it's stores the data in an E-Notation. I'm currently having to test for the presence of a 'E' in the string and handle the calculation my self. i.e. a = DECIMAL("123E+4") . What am doing now: FUNCTION E-Notation RETURNS DECIMAL ( INPUT pchStringValue AS CHARACTER ) : DEFINE VARIABLE deTempDecimalValue AS DECIMAL NO-UNDO. DEFINE VARIABLE deTempIntegerValue AS INTEGER NO-UNDO. pchStringValue = TRIM(pchStringValue) IF NUM-ENTRIES(TRIM(ImportWorkSheetData.cellValue),'E') EQ 2 THEN ASSIGN deTempDecimalValue = DECIMAL( ENTRY(1,pchStringValue,'E':U) ) deTempIntegerValue = INTEGER( ENTRY(2,pchStringValue,'E':U) ) deTempDecimalValue = deTempDecimalValue * EXP( 10, deTempIntegerValue). ELSE deTempDecimalValue = DECIMAL( pchStringValue). RETURN deTempDecimalValue. /* Function return value. */ END FUNCTION.
Continue reading...
Continue reading...