while on the topic of 'undocumented trivia that will earn you a couple of cody points for no good reason', have you seen this one?
I believe this is the very first use of the Ans Hack in Cody. See http://blogs.mathworks.com/community/2016/06/23/the-great-ans-hack/
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
amt = 34.2;
str = '$34.20';
assert(isequal(disp_currency(amt),str))
ans =
$34.20
|
2 | Pass |
%%
amt = 91337585;
str = '$91,337,585.00';
assert(isequal(disp_currency(amt),str))
ans =
$91,337,585.00
|
3 | Pass |
%%
amt = -63234922.46;
str = '($63,234,922.46)';
assert(isequal(disp_currency(amt),str))
ans =
($63,234,922.46)
|
4 | Pass |
%%
amt = 2784.9;
str = '$2,784.90';
assert(isequal(disp_currency(amt),str))
ans =
$2,784.90
|
1093 Solvers
Given two strings, find the maximum overlap
461 Solvers
6283 Solvers
Try 1.5.4: Celsius to Fahrenheit
609 Solvers
Flip the vector from right to left
2674 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!