
Implement a function that writes cents into out as a decimal amount with exactly two digits after the point, and returns the number of characters written.
money_format(1337, out)Expected result
13.37 5For your own tracking. Tests grade your code.
money_format(0, out)Expected result
0.00 4money_format(5, out)Expected result
0.05 4money_format(-1, out)Expected result
-0.01 5money_format(LONG_MIN, out)Expected result
-92233720368547758.08 21Expected files
money_format.cAllowed functions
None. Write every helper yourself.

v0.40: Create exercises. Challenge the community.
Meet Studio →Implement a function that writes cents into out as a decimal amount with exactly two digits after the point, and returns the number of characters written.
money_format(1337, out)Expected result
13.37 5For your own tracking. Tests grade your code.
money_format(0, out)Expected result
0.00 4money_format(5, out)Expected result
0.05 4money_format(-1, out)Expected result
-0.01 5money_format(LONG_MIN, out)Expected result
-92233720368547758.08 21Expected files
money_format.cAllowed functions
None. Write every helper yourself.

Run the tests to grade your code
Build your code, then check each test here. Open a result to inspect its output.