I'm working on an app to read utility meters....

(Chris Houser (Briarfox)) #1

I’m working on an app to read utility meters. Some of the old dial electric meters need to be read from right to left. I need a formula to reverse the user input. This would be fired off from an action. How can this be done? I’m unsure how to convert a number data type into a string for manipulation. Ideal process would be: 1. type cast the number into a string. 2. reverse the string 3 type cast back into number.

Is this possible?

(Chris Houser (Briarfox)) #2

I figured out how to reverse the number but now I’m not sure how to handle a variable length.

This reverses a 6 digit number: Number(

CONCATENATE(

RIGHT( text( [Electric New] ),1 ),

LEFT(RIGHT(text([Electric New]),2),1),

LEFT(RIGHT(text([Electric New]),3),1),

LEFT(RIGHT(text([Electric New]),4),1),

LEFT(RIGHT(text([Electric New]),5),1),

LEFT(RIGHT(text([Electric New]),6),1)

) )

(Chris Houser (Briarfox)) #3

This is so much more work without simple loops! This works for 4,5,6 digits.

IFS(LEN(Text([Electric New]))=4,Number(

CONCATENATE(

RIGHT( text( [Electric New] ),1 ),

LEFT(RIGHT(text([Electric New]),2),1),

LEFT(RIGHT(text([Electric New]),3),1),

LEFT(RIGHT(text([Electric New]),4),1)

) ),LEN(Text([Electric New]))=5,Number(

CONCATENATE(

RIGHT( text( [Electric New] ),1 ),

LEFT(RIGHT(text([Electric New]),2),1),

LEFT(RIGHT(text([Electric New]),3),1),

LEFT(RIGHT(text([Electric New]),4),1),

LEFT(RIGHT(text([Electric New]),5),1)

) ),LEN(TEXT([Electric New]))=6,Number(

CONCATENATE(

RIGHT( text( [Electric New] ),1 ),

LEFT(RIGHT(text([Electric New]),2),1),

LEFT(RIGHT(text([Electric New]),3),1),

LEFT(RIGHT(text([Electric New]),4),1),

LEFT(RIGHT(text([Electric New]),5),1),

LEFT(RIGHT(text([Electric New]),6),1)

) ))

(Daryn Torres) #4

Are you using OCR for reading ?

(Chris Houser (Briarfox)) #5

@Daryn_Torres Nope. Plain old manual reads. I toyed with OCR, but found it to inaccurate with all the meter types.