# Concatenate 2 numeric type values to a fixed size number [closed]

You have 2 numbers, both stored separate as numeric data type.

First number is always 6 digits long.

Second number can vary between 1 and 4 digits. If it's less than 4 digits, it needs to be padded with numeric value 0.

End result always needs to be 10 digits number.

Order has to be respected. n1|n2

Example #1:

n1 = 111111
n2 = 2222
result = 1111112222


Example #2:

n1 = 333333
n2 = 44
result = 3333330044


The rule is that you can only use numeric data types (number, int, float, decimal) to get the desired result.

• you can only use numeric data types That's close to being an unobservable requirement. What if a function I call uses strings internally? Also, this needs a winning criterion. Code golf? – Luis Mendo Oct 2 '18 at 9:34
• I have a function that converts my number to a string to process it. Am I allowed to use it? – Jo King Oct 2 '18 at 11:10
• This one seems really interesting. The only problem is that not every language can guarantee the type at every point of a variable's use. Need to maybe loosen that up a bit (or even restrict to languages that don't require any conversions, internally or otherwise). – ouflak Oct 5 '18 at 7:42

# MathGolf, 3 bytes

♫*+


Try it online!

### Explanation:

      Implicit input
♫*   Multiply first argument by 10000
+  Add the two arguments
Implicit output

• Every time i think "This seems like a good challenge for MathGolf", I find you in the answers. Nice answer, goes really well with my idea of having lots of numerical constants to aid in golfing. – maxb Oct 2 '18 at 12:18

# MATL, 5 bytes

1e4*+


Uses only addition and multiplication.

Try it online!

# 05AB1E, 4 bytes

4°*+


Try it online!

# Ruby, 14 bytes

->a,b{a*1e4+b}


# brainfuck, 45 bytes

,.,.,.,.,.,.,[-->+++>+++>+++<<<],[<,]>>>>[.<]


Try it online!

Assumes the inputted numbers are separated by a single space