CJCoding With Joseph

Interpolate with a Format Specifier

The variable price holds the double 3.5. Using string interpolation, print it as a dollar amount with exactly two decimals:

$3.50

Use a :F2 format specifier inside the interpolation.

Expected Output:

$3.50
Topics:
Printing
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cw, cr, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.