O
O
oleg50002020-07-25 21:50:12
Android
oleg5000, 2020-07-25 21:50:12

Is it always worth using BigDecimal?

If the application receives a number from the server with 4 decimal places, for example "10.1100" and this represents 10 rubles with 11 kopecks, then greater accuracy is not needed, right?
And therefore it is possible to be limited to float?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Developer, 2020-07-25
@oleg5000

There is a mistake in the backend and you need to beat them with a stick so that they give out two decimal places.
On the other hand, you can just drop the extra signs. Anyway, you are not doing anything critical on the frontend.
Any BigDecimal is out of the question.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question