Advent of Code is now back for a limited time only! Complete as many challenges as you can to earn those badges you may have missed in December. Learn more about how to participate here!
Start Free Trial

General Discussions

Discuss any topics that are not product-specific here.

Parsing out digits

lbolin
8 - Asteroid

I am wanting to check and see if the digit i have is 5 digits if it is longer than 5 digits I want to cut off the extra digits. 

Example:

544963 -----> 544963

928670000 -------> 92867

928675542 -------> 92867

72143 ------> 72143

 

 

 

 

 

 

 

3 REPLIES 3
ShankerV
17 - Castor

Hi @lbolin 

 

Please find the expected output.

 

tonumber(Left(tostring([Field1]),5))

 

ShankerV_0-1675712197774.png

 

ShankerV
17 - Castor

Hi @lbolin 

 

One more way to do this.

 

ShankerV_0-1675712533534.png

 

Many thanks

Shanker V

 

binuacs
21 - Polaris

@lbolin One way of doing this

 

binuacs_0-1675879887393.png

IIF(Length(toString([Digits])) >5 , toNumber(Left(toString([Digits]),5)), [Digits])
Labels
Top Solution Authors