noface0711

04-15-2016, 04:20 AM

Hi guys,

I had a programmer working on a custom garden builder but ran into personal issues just at the end of completing the job so I am now trying to do this myself. Unfortunately I am no expert programmer when it comes to javascript so looking for help with this one. Right now we have prices for sheds depending on the size (width and length)... so a 1.5m x 1.8m shed is a price, 2.1m x 3.6m is a price and so on. The programmer has used arrays to work out the pricing so for example 1.5m equals 1 and 3m equals 8... the price is hen worked out by matching the array values so the example I gave would use 1 and 8 as 18 to work out the price. I have posted a snippet of the code below to show how this works:

priceArray[99] = 1690;

priceArray[90] = 1845;

priceArray[01] = 540;

priceArray[02] = 720;

priceArray[03] = 840;

priceArray[04] = 970;

priceArray[05] = 1130;

priceArray[06] = 1300;

priceArray[07] = 1480;

priceArray[08] = 1680;

priceArray[09] = 1845;

priceArray[00] = 2100;

there are many variations but this is just a sample of some. All the prices are working out fine apart from the very last one. The 0 equals 3.8m so a 3.8m x 3.8m shed would be 00. Unfortunately this is the only price in the code that isn't working. Again I am no programmer but all the other prices work fine so I can only assume that the priceArray[00] isn't working because of the 00 value probably being converted as 0.

I would change the 0 to something else to represent 3.8m but the values 1-9 have all been used so I am left with 0 as the only single number left. I have thought about trying 10 as a value instead so a 3.8m x 3.8m shed would be priceArray[1010] = 2100 but then this means changing the other numbers too and I know this is just going to mess things up.

My question is basically how can I have priceArray[00] to show £2100? any ideas?

Any help would be much appreciated.

Kind regards,

I had a programmer working on a custom garden builder but ran into personal issues just at the end of completing the job so I am now trying to do this myself. Unfortunately I am no expert programmer when it comes to javascript so looking for help with this one. Right now we have prices for sheds depending on the size (width and length)... so a 1.5m x 1.8m shed is a price, 2.1m x 3.6m is a price and so on. The programmer has used arrays to work out the pricing so for example 1.5m equals 1 and 3m equals 8... the price is hen worked out by matching the array values so the example I gave would use 1 and 8 as 18 to work out the price. I have posted a snippet of the code below to show how this works:

priceArray[99] = 1690;

priceArray[90] = 1845;

priceArray[01] = 540;

priceArray[02] = 720;

priceArray[03] = 840;

priceArray[04] = 970;

priceArray[05] = 1130;

priceArray[06] = 1300;

priceArray[07] = 1480;

priceArray[08] = 1680;

priceArray[09] = 1845;

priceArray[00] = 2100;

there are many variations but this is just a sample of some. All the prices are working out fine apart from the very last one. The 0 equals 3.8m so a 3.8m x 3.8m shed would be 00. Unfortunately this is the only price in the code that isn't working. Again I am no programmer but all the other prices work fine so I can only assume that the priceArray[00] isn't working because of the 00 value probably being converted as 0.

I would change the 0 to something else to represent 3.8m but the values 1-9 have all been used so I am left with 0 as the only single number left. I have thought about trying 10 as a value instead so a 3.8m x 3.8m shed would be priceArray[1010] = 2100 but then this means changing the other numbers too and I know this is just going to mess things up.

My question is basically how can I have priceArray[00] to show £2100? any ideas?

Any help would be much appreciated.

Kind regards,