# How do I pick only the first value of a 2 digit int-checksum

From the Asset Store
Pick Up Items Sound effects for your game, Take them for a ride right now and you will worry no more.
• Hi folks, i hope you can help me with this small problem.

the user enters two numbers, from which the programm calculates the cross sum and stores it in a variable.

for example 4 | 5 = 9

Problem is the cross sum can only habe one diget.

so if the user enters 8 | 9 =17

then the program should pick the 1 and the 7 and calculate the cross sum again:

8 | 9 =17

1 | 7 = 8

i undersstand that i can check if the result is bigger than 9 but i either then have to select each digit single OR there is some function i didnt find so far.

is there a function to calculate the cross total (checksum)?

Kind regards

Patrick

• Dividing by ten (as an int) gets the first number, Modulus gets the second.

int(Variable/10) + Variable%10

• ## Try Construct 3

Develop games in your browser. Powerful, performant & highly capable.

Construct 3 users don't see these ads
• wow thanks

works for me!

Kind Regards

• 3 posts