R
R
rinatoptimus2015-06-06 11:00:09
Angular
rinatoptimus, 2015-06-06 11:00:09

How to count decimals in Angular?

You need to calculate the amount and at the same time calculate it including VAT (16% and 18%), i.e. multiply it by 0.18 or by 0.16.
So far, it turns out to multiply only by an integer, but not by a fractional one. In this case, it is multiplied by 16, but not by 0.18:
codepen.io/rinatoptimus/pen/wadWqV
1) How to multiply by 0.18?
2) How to remove NaN in the place where the result appears?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel Kononenko, 2015-06-06
@rinatoptimus

Use not parseInt, but parseFloat in
codepen.io/anon/pen/qdmNoo filter

R
rinatoptimus, 2015-06-06
@rinatoptimus

Excuse me, but could you tell me about the second point in the question?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question