Here are some exercises to try out:
- Show the Avogadro number, 6,02,21,40,76,00,00,00,00,00,00,000, in scientific notation. The number of digits after the decimal point before the e should be three.
- Show 65,535 as a hexadecimal number.
- Show 58.25354 as a percentage.
- Format the current date as yyyy-MM-dd without using the -Format parameter of Get-Date.
Done? Here are the solutions:
- "{0:e3}" -f 602214076000000000000000
- "0x{0:x}" -f 65535
- "{0:p}" -f 58.25354
- "{0:yyyy-MM-dd}" -f (Get-Date)