Skip to content

Instantly share code, notes, and snippets.

@MartinElvar
Created September 16, 2015 17:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MartinElvar/da69f9f6a09d3cd5b61f to your computer and use it in GitHub Desktop.
Save MartinElvar/da69f9f6a09d3cd5b61f to your computer and use it in GitHub Desktop.
"249,0" |> String.replace ~r/,(\d)$/, ",\\1"
# -> "249,0"
"249,0" |> String.replace ~r/,(\d)$/, ",\\10"
# -> "249,"
# The closest i can get.
"249,0" |> String.replace ~r/,(\d)$/, ",\\1 0"
# -> "249,0 0"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment