0

Consider the case wherein there needs to be a price tier structure that needs to be deployed on the network. Take the following tier structure for example:
Tier|Region 1|Region 2|Region 3 1|11.99|0|0 2|12.99|0|0 uint[3][2] tier; tier = [[1199,0,0],[1299,0,0]]; Essentially what needs to be established is, if a certain price of a product is below 11.99, then the value needs to be taken as 11.99 and similarly for the second tier. I have tried leveraging multi-dimensional arrays but have been facing errors in conversion.

Any suggestions as to how I can resolve this issue and retrieve the values by querying the array?

skarred14
  • 945
  • 1
  • 9
  • 18
  • You've phrased this as a problem with arrays but it looks like your actual problem is related to decimals? Solidity doesn't do them, so make your contract handle cents not dollars (or whatever the equivalent is in whatever units those numbers are) and do the conversion in the UI. – Edmund Edgar Sep 20 '17 at 11:11
  • thanks - I changed the declaration for uint[][]. I am getting an error: "unable to deduce common type for array elements" – skarred14 Sep 20 '17 at 11:18

0 Answers0