-
-
Save parzibyte/5c7e5c767e1a964029b4326097111a3a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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