Help converting a number to ones position only | Community
Skip to main content
Level 2
June 10, 2024
Solved

Help converting a number to ones position only

  • June 10, 2024
  • 1 reply
  • 710 views

Hello,

 

I am stumped. I need to be able to convert a number to its ones value only. For example: if someone enters 65, I need it to return only the 5. Another example: 87 returns only the 7, etc. There will be no decimal numbers.

 

Any idea how I could accomplish this?

 

Thank you

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Vijay_Katoch

The below script will give you the desired data.

var yourFieldValue = yourField.rawValue;
var convertedValue = yourFieldValue.toString().substr(-1);

1 reply

Vijay_Katoch
Community Advisor
Vijay_KatochCommunity AdvisorAccepted solution
Community Advisor
June 11, 2024

The below script will give you the desired data.

var yourFieldValue = yourField.rawValue;
var convertedValue = yourFieldValue.toString().substr(-1);

LabrecloAuthor
Level 2
June 11, 2024

Wow thank you Vijay. It's embarrassing when the answer is literally two lines 😞