1
Starting a draft for parking charge I need to know the best way to calculate the values based on the amount of minutes. So it’s not working, I believe I have errors in logical operators (I’m not familiar with Javascript)
var valor_total = 0.00;
if(tempo_considerado <= 0){
valor_total = 0.00;}
if(tempo_considerado > 0 <= 10){
valor_total = 0.00;}
if(tempo_considerado > 10 <= 15){
valor_total = 2.50;}
if(tempo_considerado > 15 <= 30){
valor_total = 4.00;}
if(tempo_considerado > 30 <= 45){
valor_total = 5.00;}
if(tempo_considerado > 45 <= 60){
valor_total = 6.00;}
if(tempo_considerado > 60){
valor_total = 10.00;}
valor_total = Math.floor(valor_total).toFixed(2);
Nãu would be so if(time_considered > 0 && time_considered <= 10)
– Bruno H.
the
tempo considerado
was not considered, ie was not declared :)– user60252
Actually the time_considered variable comes from a previous code block
– Ezequiel Tavares
there are who think that Stackoverflow users have telepathic magical powers and are able to guess exactly what is happening in the environment of those who ask. They believe that these superpowered beings can guess what the code is and all the other information they need without having to see anything about it and are still able to figure out what’s wrong with it. Thus, these users believe that it is not necessary to place this information in the text of the question because it can be obtained by those who answer through supernatural and paranormal means.
– user60252