PDA

View Full Version : [Guide] Separate a number into 1, 10, 100..

JolanXBL
03-10-2019, 01:20 AM
Here's how you can convert a Variable Data Source (or any number) into separate data sources for each number position. This is often used when trying to create a large counter in the game world with numbers from the Trials Fusion pack, or decals in Trials Rising.

It looks complicated but here we go.
Modulo is the number(s) on the right, after a calculation.
So 5 ÷ 10 = 0.5, the Modulo is 5.
In your case, 237 ÷ 10 = 23.7, the Modulus is 7.

Now subtract the Modulo value from your number, and then get the Modulo for the last 2 digits.
230 Mod 100 = 30. Divide by 10 to remove the 0 gives your tens. (3)

Do this again.
230 - 30 = 200
200 ÷ 100 = 2 (hundreds)

This is a Modulo calculator:
https://www.miniwebtool.com/modulo-calculator/

The code:
One of the math tool cards, I think it's the 2-input Operator, will have something in it called mod or modulo.

Terms
Each result = Letters
Toolcards are all 2-Input Operators, labeled 2IO.

2IO
Type = Mod
input1 = VDS
input2 = 10
Result A should be 7.

2IO
Type = Subtract
input1 = VDS
input2 = A
Result B (230)

2IO
Type = Mod
input1 = B
input2 = 100
Result C (30)

2IO
Type = Divide
input1 = C
input2 = 10
Result D (3)

2IO
Type = Subtract
input1 = B
input2 = C
Result E (200)

2IO
Type = Divide
input1 = E
input2 = 100
Result F (2)

Now we have all 3 numbers in 3 VDS's:
237
E = 2
D = 3
A = 7