Updating printf functions

Updating printf functions to print numbers and floats.
This commit is contained in:
Nicholas Chen 2019-09-18 21:41:04 -04:00 committed by GitHub
parent c353827bc4
commit 0655d01d62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -678,6 +678,12 @@ source "${0%/*}/../share/foo.sh"
```bash ```bash
printf "Hello %s, I'm %s" Sven Olga printf "Hello %s, I'm %s" Sven Olga
#=> "Hello Sven, I'm Olga #=> "Hello Sven, I'm Olga
printf "1 + 1 = %d" 2
#=> "1 + 1 = 2"
printf "This is how you print a float: %f" 2
#=> "This is how you print a float: 2.000000"
``` ```
### Directory of script ### Directory of script