Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created Aug 13, 2021
Embed
What would you like to do?
package main
import "fmt"
func agregarCeroSiEsNecesario(valor int) string {
return fmt.Sprintf("%02d", valor)
}
func main() {
fmt.Println(agregarCeroSiEsNecesario(9))
fmt.Println(agregarCeroSiEsNecesario(10))
fmt.Println(agregarCeroSiEsNecesario(100))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment