Auto calculate letter "1=A" and able to use with spinner

149
1
04-12-2024 10:55 AM
Status: Open
SteveBrewer
New Contributor III

We have a federally standardized form for shoreline cleanup and recovery from oil spills, and maybe there is a way to do this that can be functional offline as well but with each new zone in a repeat we would like to have instead of numbers, letters. So A=1, B=2, C=3, D=4, 

1 Comment
abureaux

You can do this now, but you need to manually assign letters to numbers. I quickly put together something that work up to 104 (or CZ). It could pretty easily be expanded beyond that by continuing the pattern in ${alphabit_cap} and ${alphabit_rollover}.

It uses an integer/spinner for input, but you could also use something like an index(..) calculate in a repeat for automatic input.

 

typenamelabelappearancereadonlycalculate
integernum_testNumberspinner  
calculatealphabit_cap   if(${num_test}>=27 and ${num_test}<=52,${num_test}-26,if(${num_test}>=53 and ${num_test}<=78,${num_test}-52,if(${num_test}>=79 and ${num_test}<=104,${num_test}-78,${num_test})))
calculatealphabit_rollover   if(${num_test}>=27 and ${num_test}<=52,'A',if(${num_test}>=53 and ${num_test}<=78,'B',if(${num_test}>=79 and ${num_test}<=104,'C','')))
calculatealphabit_letter yes if(${alphabit_cap}=1,'A',if(${alphabit_cap}=2,'B',if(${alphabit_cap}=3,'C',if(${alphabit_cap}=4,'D',if(${alphabit_cap}=5,'E',if(${alphabit_cap}=6,'F',if(${alphabit_cap}=7,'G',if(${alphabit_cap}=8,'H',if(${alphabit_cap}=9,'I',if(${alphabit_cap}=10,'J',if(${alphabit_cap}=11,'K',if(${alphabit_cap}=12,'L',if(${alphabit_cap}=13,'M',if(${alphabit_cap}=14,'N',if(${alphabit_cap}=15,'O',if(${alphabit_cap}=16,'P',if(${alphabit_cap}=17,'Q',if(${alphabit_cap}=18,'R',if(${alphabit_cap}=19,'S',if(${alphabit_cap}=20,'T',if(${alphabit_cap}=21,'U',if(${alphabit_cap}=22,'V',if(${alphabit_cap}=23,'W',if(${alphabit_cap}=24,'X',if(${alphabit_cap}=25,'Y',if(${alphabit_cap}=26,'Z',''))))))))))))))))))))))))))
textletter_outputLetter  concat(${alphabit_rollover},${alphabit_letter})