orientdb - In orient-db how can i round up a decimal value -
in orientdb have sample query of problem
select eval('((23 + 46) * 1.0 ) / 2') abc someclass
above query returns 34.5 want round 35. applied asinteger() didn't work.
select eval('((23 + 46) * 1.0 ) / 2').asinteger() abc someclass
above query returns 34 want 35
i don't know if there native functions achieve that.
but create javascript function studio called example ceil
and in body work.
try insert function.
insert ofunction set name = 'ceil', language = 'javascript', code = 'return math.ceil(num);', parameters = ["num"]
and then
select ceil(eval('((23 + 46) * 1.0 ) / 2'))
Comments
Post a Comment