Addition with Angular result is not ok!

  <div ng-app="" ng-init="quantity=itemValue('Grenze_Diesel');diff='0.01'">
      <p>Neuer Preisq: {{  quantity }}</p>
      <p>Neuer Preisd: {{  diff }}</p>
      <p>Neuer Preis1: {{  quantity + diff }}</p>
      <p>Neuer Preis2: {{  quantity - diff }}</p>
      <p>Neuer Preis3: {{  quantity * diff }}</p>
      <p>Neuer Preis4: {{  quantity / diff }}</p>  
 </div>

**Preis1 does not match the result ** (treated as a string) ****
parseFloat (…) doesn’t help either
all other results are ok what is wrong?

Grenze_Diesel = 1.12

Preisq = 1.12
Preisd = 0.01
Preis1 = 1.120.01
Preis2 = 1.11
Preis3 = 0.0112000
Preis4 = 112.000

Try

<p>Neuer Preis1: {{  quantity*1 + diff*1 }}</p>

Hello Wolfgang THANK YOU

This is how it is calculated correctly.

is that a mistake or have I overlooked something? All the while I thought that float operation is not possible.
I would like to understand the case. Why are other operations right?

Greetings Franz

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.