Cody

Solution 1900416

Submitted on 14 Aug 2019
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
amt = 34.2; str = '$34.20'; assert(isequal(disp_currency(amt),str))

S = '$34.20'

2   Pass
amt = 91337585; str = '$91,337,585.00'; assert(isequal(disp_currency(amt),str))

S = '$91,337,585.00'

3   Pass
amt = -63234922.46; str = '($63,234,922.46)'; assert(isequal(disp_currency(amt),str))

S = '($63,234,922.46)'

4   Fail
amt = 2784.9; str = '$2,784.90'; assert(isequal(disp_currency(amt),str))

S = '$2784.90'

Undefined function or variable 's'. Error in disp_currency (line 16) t=strcat(s(1:2),','); Error in Test4 (line 3) assert(isequal(disp_currency(amt),str))