SET FIXED OFF SET TALK OFF CLEAR CREATE CURSOR orderRows (quantity N(10,1),weight N(12,6)) INSERT INTO orderRows VALUES (24,86.173125) FOR nDec=0 TO 11 STEP 5 ? TRANSFORM(m.nDec,'@R -------- SET DECIMAL TO 99 ----------') SET DECIMALS TO m.nDec varDec1 = 3.1255 varDec4 = 2.5567 scanTotalWeight=0.0 SCAN STORE m.scanTotalWeight+quantity*weight to scanTotalWeight ENDSCAN SELECT SUM(quantity*weight) totalweight FROM orderRows INTO array selTotalWeight SUM quantity*weight TO sumTotalWeight CALCULATE SUM(quantity*weight) TO calcTotalWeight && + RAPIDO ? 'into variable ', scanTotalWeight && i aspected 7 decimals ? 'SELECT ', selTotalWeight && i aspected 7 decimals ? 'SUM ', sumTotalWeight && i aspected 7 decimals ? 'CALCULATE ',calcTotalWeight && i aspected 7 decimals ? 'literal product ',3.1*2.5567 && i aspected 4 decimals ? 'literal division ',3.1/2.5567 && i wish full decimals ? 'variable division ',m.varDec1/m.varDec4 && i wish full decimals ? 'integer exponentation ',3.1^8 && i wish 8 decimals ? 'fractional exponentation ',3.1^2.5567 && i wish full decimals ? 'TRANSFORM INTEGER ',TRANSFORM(215.085*1000.0) && i aspected 4 decimals ? 'TRANSFORM DECIMAL ',TRANSFORM(215.085*1001.0) && i aspected 4 decimals ? RELEASE varDec1,varDec4,zz NEXT ? ? '******* Rule to compute decimal on result *******' ? 'into variable decResult = MAX(decItems,decProduct)' && correct ? 'SELECT decResult = MAX(decExpItems,decProducts)' && correct ? 'SUM decResult = MAX(decItems,decProducts,setDecimal)' && incorrect ? 'CALCULATE decResult = setDecimal' && bug ? 'literal product decResult = MAX(sum(decItems),setDecimal)' && incorrect ? 'literal division decResult = MAX(sum(decItems),setDecimal)' && incorrect ? 'variable division decResult = MAX(4,setDecimal+2)' && i can found words ? 'literal exponent decResult = MAX(decFirstItem,setDecimal)' && incorrect ? 'TRANSFORM INTEGER decResult = 0' && it is a design choice ? 'TRANSFORM DECIMAL decResult = MAX(decItems,decProducts,setDecimal)' && incorrectThe only simplified rule is this.