hello, how can I round a Decimal in prisma to 2 de...
# orm-help
d
hello, how can I round a Decimal in prisma to 2 decimals
Copy code
3.6666666666666666667
to
3.67
I prefer not to use
toFixed
because that will make it a string. I want to keep the type
Decimal
r
@Dev__ 👋 This method should work for you.
d
dont think thats what I am looking for 🤔
Returns a new Decimal whose value is the value of this Decimal clamped to the range delineated by min and max.
r
Ohh, in that case, this method would work.
d
ah nice, thanks. must've missed that one
👍 1
is there also a way to round always to 2 decimals even if rounded values
Copy code
2.5 > 2.50
2 > 2.00