Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
filetext = fileread('num2words.m');
assert(isempty(strfind(filetext, 'six hundred and seventy-nine')))
assert(isempty(strfind(filetext, 'one thousand, five hundred and twenty')))
|
2 | Pass |
x = 0;
y_correct = 'zero';
assert(isequal(num2words(x),y_correct))
|
3 | Pass |
x = 1;
y_correct = 'one';
assert(isequal(num2words(x),y_correct))
|
4 | Pass |
x = 56;
y_correct = 'fifty-six'
assert(isequal(num2words(x),y_correct))
y_correct =
'fifty-six'
|
5 | Pass |
x = 100;
y_correct = 'one hundred';
assert(isequal(num2words(x),y_correct))
|
6 | Pass |
x = 105;
y_correct = 'one hundred and five';
assert(isequal(num2words(x),y_correct))
|
7 | Pass |
x = 245;
y_correct = 'two hundred and forty-five';
assert(isequal(num2words(x),y_correct))
|
8 | Pass |
x = 679;
y_correct = 'six hundred and seventy-nine';
assert(isequal(num2words(x),y_correct))
|
9 | Pass |
x = 1520;
y_correct = 'one thousand, five hundred and twenty';
assert(isequal(num2words(x),y_correct))
|
10 | Pass |
x = 9999;
y_correct = 'nine thousand, nine hundred and ninety-nine';
assert(isequal(num2words(x),y_correct))
|
Extract leading non-zero digit
1205 Solvers
It dseon't mettar waht oedrr the lrettes in a wrod are.
653 Solvers
Test if a Number is a Palindrome without using any String Operations
181 Solvers
103 Solvers
Find last zero for each column
239 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!