2012-01-29 83 views
0

在Pentaho程序中,使用修改的javascript步驟。使用product.csv文件,在unitPrice字段中,某個整數具有正數,其他則爲負數。在JavaScript中,我該如何輸入?Pentaho/Javascript:如何將字段值(unitPrice)從負整數更改爲正整數?

這裏我輸入的例子到目前爲止仍然是一個錯誤。

if(unitPrice.getInteger() < 0) 
{ 
    unitPrice.setValue(var) = Math.abs(unitPrice.getInteger()); 
} 
+0

約 'Pentaho的',不知道,但我的猜測是'unitPrice.setValue(Math.abs(unitPrice.getInteger()))' – georg 2012-01-30 00:05:10

回答

0
  1. 使用代碼thg435建議:

    unitPrice.setValue(ABS(單價));

  2. 檢查'修改後的Java腳本值'組件中的'兼容模式'。

問候 Mateusz

相關問題