hi i am new here and i am codding a litttle program to calculate the price by unit of a product depend on his quantitie and price (the product coming in 12pcs, 18pcs and 20pcs)and i want to console log wichone is the one have the minimun price if is the 12 console log dozen if is the minimun, eighteen the same etc. I be able to console log the minimun price(the number) with Math.min but i dont know who belongs to if is from 12pcs,18pcs or 20pcs Sorry if my english is not good its my second language
var docena="12";
var dieciocho="18";
var veinte="20";
var precio_docena=prompt("precio docena");
var precio_dieciocho=prompt("precio dieciocho");
var precio_veinte=prompt("precio veinte");
var precio_unidad12=precio_docena/docena;
var precio_unidad18=precio_dieciocho/dieciocho;
var precio_unidad20=precio_veinte/veinte;
Aucun commentaire:
Enregistrer un commentaire