Output N in base -10 Challenge:

In the programming language of your choice, accept an integer  as input in base 10, and output it in the negadecimal notation, which is also known as base -10

Example algorithm:

This is an algorithm taken from Wikipedia to convert base 10 to any negative base in VB.NET:



Function toNegativeBase(Number As Integer , base As Integer) As System.Collections.Generic.List(Of Integer)

    Dim digits As New System.Collections.Generic.List(Of Integer)
    while Number &lt;&gt; 0
        Dim remainder As Integer= Number Mod base
        Number = CInt(Number / base)

        if remainder &lt; 0 then
            remainder += system.math.abs(base)
            Number+=1
        end if

        digits.Insert(0, remainder)
    end while

    return digits
end function


Obviously, you can use any algorithm, as long as it fulfills the challenge

Example inputs / outputs:

Input:

12


Output:

192


Another example:

Input:

2048


Output:

18168


Rule:

You must not use any built-in methods that solve this problem that exist in your programming language

This is a code-golf, so shortest code wins!
JavaScript (ES6), 51 45 37 bytes

f=n=&gt;n&amp;&amp;n%10+((k=n&lt;0)+f(k-n/10|0))*10


Test cases



f=n=&gt;n&amp;&amp;n%10+((k=n&lt;0)+f(k-n/10|0))*10

console.log("12 -&gt; " + f(12))
console.log("2048 -&gt; " + f(2048))