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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -