g | x | w | all
Bytes Lang Time Link
045C gcc241212T235751Zmatteo_c
021Perl 5 p241210T150204ZXcali
053Java241210T154208ZKevin Cr
01605AB1E241210T095646ZKevin Cr
021Charcoal241210T115752ZNeil
014Retina 0.8.2241210T095453ZNeil
042JavaScript Node.js241210T080536Ztsh

C (gcc), 45 bytes

f(char*x){*x=*x-48|x[1]%46<1?*x-46?*x:36:45;}

Try it online!

Perl 5 -p, 25 21 bytes

@Neil saved 4 bytes

s/^[.\$]/\$/;s;^0\B;-

Try it online!

Java, 57 53 bytes

s->s.replaceAll("^0\\B","-").replaceAll("^\\.","\\$")

-4 bytes thanks to @Neil.

Try it online.

Explanation:

s->                     // Method with String as both parameter and return-type
  s.replaceAll("^0      //  Replace a leading "0",
                  \\B", //  which has a (zero-width) digit after it
               "-")     //  with "-"
   .replaceAll("^\\.",  //  Then(/or) replace a leading "."
               "\\$")   //  with "$"

05AB1E, 21 16 bytes

¦нdić„-$ì¤0tskèì

Try it online or verify all test cases.

Explanation:

¦                # Remove the first character of the (implicit) input
 н               # Pop and take the new first character (aka the second),
                 # or an empty string if the input was 1 character long
  di             # Pop, and if this second character is a digit:
    ć            #  Extract head; push first character and remainder-string
     „-$ì        #  Prepend "-$" before this first character
         ¤       #  Push the last character of this triplet (without popping),
                 #  aka that same first character
          0t     #  Push 0.0 (square root of 0)
            s    #  Swap so the first character is at the top again
             k   #  Get the 0-based index of this character in "0.0",
                 #  or -1 if it's neither "0" nor "."
              è  #  Use that index to index into "-$ÿ",
                 #  where -1 indexes into this last character (`ÿ`)
               ì #  Prepend that to the remainder-string
                 #  (after which it is output implicitly as result)
                 # (implicit else: output the implicit input as is)

Charcoal, 21 bytes

Pθ¿‹.⊟KD²→§⁺-$KK⌕0.KK

Try it online! Link is to verbose version of code. Explanation:

Pθ

Output the input string without moving the cursor.

¿‹.⊟KD²→

If the second character exists and is a digit, then...

§⁺-$KK⌕0.KK

... transliterate the character under the cursor from 0 to - or . to $ or anything else to itself.

Retina 0.8.2, 14 bytes

1T1`0.`-$`^.\d

Try it online! Link includes test cases. Explanation: Port of @tsh's JavaScript answer.

1T1`

Transliterate only the first character of the first match. (There will only be one match, but I still need to specify it so that I can only transliterate the first character.)

0.`-$`

Transliterate 0 to - and . to $.

^.\d

Match only the first two characters and only if the second is a digit. (Transliterate will ignore the first character if it's not a 0 or ..)

JavaScript (Node.js), 42 bytes

s=>s.replace(/^[0.](?=\d)/,x=>x<1?'-':'$')

Try it online!