Skip to content

Commit 52c46d1

Browse files
authored
Merge pull request totaljs#463 from totaljs/fix-f_convert
Fixed F.convert
2 parents c8aa097 + 1c23327 commit 52c46d1

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

index.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -826,14 +826,19 @@ Framework.prototype.convert = function(value, convertor) {
826826
else if (typeof(convertor) === 'string') {
827827
switch (convertor.toLowerCase()) {
828828
case 'json':
829-
return U.parseJSON;
829+
convertor = U.parseJSON;
830+
break;
830831
case 'float':
831832
case 'number':
832833
case 'double':
833-
return U.parseFloat;
834+
convertor = U.parseFloat;
835+
break;
834836
case 'int':
835837
case 'integer':
836-
return U.parseInt2;
838+
convertor = U.parseInt2;
839+
break;
840+
default:
841+
return console.log('F.convert unknown convertor type:', convertor);
837842
}
838843
}
839844

0 commit comments

Comments
 (0)