You can use String.pad_leading/3
my_count
|> Integer.to_string
|> String.pad_leading(3, "0")
Related Contents:
- How can I schedule code to run every few hours in Elixir or Phoenix framework?
- How to join strings in Elixir?
- How do you check for the type of variable in Elixir
- Elixir: use vs import
- Convert Elixir string to integer or float
- What is the benefit of Keyword Lists?
- How to check if an item exists in an Elixir list or tuple?
- Is there a Phoenix equivalent to Rails Console
- IEx – How to cancel multiline command?
- Getting the current date and or time in Elixir
- Elixir: When to use .ex and when .exs files
- How to run an Elixir application?
- What’s the difference between `def` and `defp`
- How to convert map keys from strings to atoms in Elixir
- Run shell commands in Elixir
- Elixir Sleep / Wait for 1 Second
- In Elixir how do you initialize a struct with a map variable
- How do I raise a number to a power in Elixir?
- How to create a map from a list of two item tuples in Elixir
- In Elixir, is there any way to get a module to list its functions?
- Debugging and debugging tools in Elixir?
- How to Log something in Controller when Phoenix Server is running?
- In Elixir’s ExUnit, is it possible to just run one test?
- How do I recompile an Elixir project and reload it from within iex?
- In Elixir, how can a range be converted to a list?
- Add new element to list
- How to use IO.inspect on a long list without trimming it?
- Is there a way to test private functions in modules in ExUnit of Elixir?
- How can I make Mix run only specific tests from my suite of tests?
- How do you define constants in Elixir modules?
- How do you pass a function as a parameter in Elixir?
- How to use the “with” keyword in Elixir and what is it for?
- How to read config variable in Phoenix / Elixir?
- Catch-all/wildcard route in Elixir’s Phoenix?
- How to connect two Elixir nodes via local network?
- How to alter a column name in an Ecto model with a migration?
- Lists vs. Tuples – What to use and when?
- Difference between protocol & behaviour in elixir
- How to use raw sql with ecto Repo
- How can I see the raw SQL generated for an Ecto.Query?
- Add / Remove key-value pairs from a Map
- How to pass an anonymous function to the pipe in Elixir
- Elixir – try/catch vs try/rescue?
- Creating a unique constraint on two columns together in Ecto
- How do I save IEx history?
- How to generate a random url safe string with Elixir
- What are Elixir Bang Functions?
- assert the size of the list in elixir
- How to create a dynamic function name using Elixir macro?
- cannot use ^xxx outside of match clauses