I'm working on macromod code that will allow me to do calculations that have decimals. However, I'm having trouble specifically with the MATCH command. I want to turn each digit into a separate variable so I can then manually insert a decimal point. However, I can't find any good documentation on the MATCH command so I've resorted to reading other macros for help and I'm lost. Code: $${ #calc = 1/2 if(#calc = 0) #calc = (1*10)/2 #decianswer = #calc*251 if(#decianswer < 100) &answer = 0.%#decianswer% log("%&answer%") elseif((#decianswer >= 100) && (#decianswer < 1000)) &answer = %#decianswer% log("%&answer%") elseif(#decianswer >= 1000) match(%#decianswer%,^([0-9]+)([0-9]+)([0-9]+)([0-9]+), {#digit4, #digit3, #digit2, #digit1}) //This is where my problem is #wholeanswer = #digit4*100+#digit3*10+#digit2 log("%#wholeanswer%.%#digit1%") endif endif }$$
@priMELval I saw your calculator however I don't need a full calculator. I was trying to figure out how to extract portions of your code to use for just multiplying two numbers however the symbols in the MATCH portion were confusing to me so I decided I was just going to create one from scratch instead until I realized that I still needed the MATCH. It would be great if you could show me where you learned how MATCH and its contents work or just let me know. Thanks for the help though!