Browse Source

fix: ROUNDUP precision issue

pull/7019/head
Pranav C 12 months ago
parent
commit
b346569a26
  1. 4
      packages/nocodb/src/db/functionMappings/commonFns.ts

4
packages/nocodb/src/db/functionMappings/commonFns.ts

@ -201,7 +201,7 @@ export default {
return {
builder: knex.raw(
`ROUND(FLOOR((${valueBuilder}) * POWER(10, ${precisionBuilder})) / POWER(10, ${precisionBuilder}))${colAlias}`,
`ROUND((FLOOR((${valueBuilder}) * POWER(10, ${precisionBuilder})) / POWER(10, ${precisionBuilder})::numeric(30,${precisionBuilder})))${colAlias}`,
),
};
},
@ -215,7 +215,7 @@ export default {
return {
builder: knex.raw(
`ROUND(CEIL((${valueBuilder}) * POWER(10, ${precisionBuilder})) / POWER(10, ${precisionBuilder}))${colAlias}`,
`ROUND((CEIL((${valueBuilder}) * POWER(10, ${precisionBuilder})) / POWER(10, ${precisionBuilder}))::numeric(30,${precisionBuilder}))${colAlias}`,
),
};
},

Loading…
Cancel
Save