Hi I am having an issue with deciding how to store/calculate a value. The value is this case is dynamically generated by executing a javascript function that is stored in a mysql database.
The company I work for originally did this because other values that are used by the stored javascript function can be changed and because this is done by a AJAX request, the value needs to be calculated on the clients side. Somehow this doesn't feel right, and I think there has to be a better way to store this.
Now I am not sure how I should solve this, but I hope some of you can point me in the right direction.
I hope I explained the problem clear enough.
EDIT: An example. There is a value x that needs to be calculated and currently this happens.
function example(){
if(y == true){
return 0;
}
var result = z / areaM2;
if(result > 100){
return 1;
}
else{
return 2;
}
}
x = example();
y, z and areaM2 are actual stored variables.