Hello, is there any rounding through the search? `...
# suitescript
m
Hello, is there any rounding through the search?
Copy code
I need 18714.28523423434324234 => 18714.28
When i use Group , it doesn't work for script search
Copy code
r.getValue({ name: 'formulacurrency', formula: 'TO_NUMBER({amount})', summary: SearchSummary.SUM })
d
from your example you either want to FLOOR or TRUNC (as just rounding
18714.285…
would result in
18714.29
) If you actually want to round to 2d.p. you could use ROUND, but you could also use the
func
parameter that Result.getValue() takes, with value "roundToHundredths" Speaking of Result.getValue(),
formula
isn't a valid parameter. if you're trying to differentiate between multiple 'formulacurrency' columns, you have 3 options:
result.columns[_{columnindex}_]
see here
result.getValue('formulacurrency_uniqueidentifier')
see here (same as above)
result.getValue(column)
see here