-2

How can i calculate the sum of some scopes and rest the sum of other scopes with 30% discount?:

{{(data.a * 30) + (data.b * 10) + data.c - [(data.d * 5)+(data.e * 0.75)] * 30 / 100}}

I tried this and it's not working:

{{data.dominio + data.alojamiento + data.logotipo + data.pagespeed + (data.categoriasblog * 10) + (data.entradasblog * 10) + data.mapa + data.soporte + data.seo + data.multi + (data.cattien50 * 10) + (data.cattien200 * 10) + (data.cattien600 * 8) + (data.cattien5000 * 2) + (data.prodtien50 * 2) + (data.prodtien200 * 2) + (data.prodtien600 * 2)  + (data.prodtien5000 * 0.50) + (data.metpag50 * 5) + (data.metpag200 * 5) + (data.metpag600 * 2) + (data.metpag2000 * 0.75) + (data.metpag5000 * 0.5) + (data.metenv50 * 5) + (data.metenv200 * 5) + (data.metenv600 * 4) + (data.metenv2000 * 3) + (data.metenv5000 * 2) + data.pesoydim50 +  data.pesoydim200 + data.pesoydim600 + data.pesoydim2000 + data.pesoydim5000 + data.tpv50 + data.tpv200 + data.tpv600 + data.tpv2000 + data.tpv5000 - (data.cattien2000 * 5) - (data.prodtien2000 * 0.75) * 0.30}}

The project is posted here: https://creator.ionic.io/share/html/2d9b0126751e#/menu/tienda

The scenario is:

U need to choose from the dropdown "Tipo de tienda" -> De 601 - 2000 productos Select the number of the categories and products and on the bottom i have to apply a 30% discount based of the cost of those products and categories.

On the final step i have a resume, wich calculates all the values and should discount the 30% if the user has a .csv file with those products.

Mistalis
  • 17,793
  • 13
  • 73
  • 97
  • 1
    This description is not enough to go on. Please provide more details on the problems you are experiencing. – big_water Oct 20 '16 at 13:35

2 Answers2

0
{{

((data.a * 30) + (data.b * 10) + data.c - (data.d * 5)-(data.e * 0.75)) * 0.30

}}
joncodo
  • 2,298
  • 6
  • 38
  • 74
0

[ ] is for arrays. If you need double parenthesis just use... ( ) two times!

{{(data.a * 30) + (data.b * 10) + data.c - ((data.d * 5) + (data.e * 0.75)) * 30 / 100}}

Here is a demo on JSFiddle.

Mistalis
  • 17,793
  • 13
  • 73
  • 97