php - Calculate price form excel javascript -
on website customer fills in height , width. round number echo round(657, -2, php_round_half_up);
example.
so have width & height in hundreds. price scheme: *breedte = width, hoogte = height in millimeters. result price.
the calculation have been simple if there formula. width * height = x. x * y = price. don't know y. client says y irregular , cannot found. think otherwise. math guys, if can find formula have eternal thanks.
now real question. let's turn massive function php or fill in database calculate price. painful. best way it? php function? javascript function? fill database , retrieve price there?
if can find pattern in data , able calculate x , y coordinates, can make function. preferably in business logic of application (that php, not javascript).
otherwise you'll looking @ lookup table. it's best not hard-code these, , maintainability you're going want put these values either in file or database separate code, can adjust them in future.
i'd suggest either using database or csv-like file, can edited non-tech people using right software.
Comments
Post a Comment