is there a way to convert a `Prisma.Decimal` to a ...
# orm-help
d
is there a way to convert a
Prisma.Decimal
to a float? whenever I return it always sends it as a string
r
Not yet, do watch this for more updates 🙂 https://github.com/prisma/prisma/issues/7158
d
any alternatives?
e
I had to do this:
merchantBatch = await createMerchantBatch(batches[0], options, useDate);
    merchantBatch.totalAmount *= 1; // <- Prisma is not returning a Number for this, so we need to do this
d
typescript is complaining 😅
what I did
Copy code
const value = decimal.toString()
parseFloat(value)
toNumber also works fine
s
I use
.toNumber()
everywhere