Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Uncaught TypeError: Object function String() { [native code] } has no method 'format' #394

Open
MaxEden opened this issue Aug 26, 2013 · 1 comment

Comments

@MaxEden
Copy link

MaxEden commented Aug 26, 2013

ss.js

_formatters['Number'] = function(number, format, culture) {
...
case 'p': case 'P':
if (precision == -1) {
precision = nf.perDD;
}
s = (Math.abs(number) * 100.0).toFixed(precision).toString();
if (precision && (nf.perDS != '.')) {
var index = s.indexOf('.');
s = s.substr(0, index) + nf.perDS + s.substr(index + 1);
}
s = _commaFormatNumber(s, nf.perGW, nf.perDS, nf.perGS);
if (number < 0) {
s = String.format(culture, nf.perNP, s);
}
else {
s = String.format(culture, nf.perPP, s);
}
break;

Possibly there should be
ss.format

@nikhilk
Copy link
Owner

nikhilk commented Aug 29, 2013

Yes - looks leftover from previous implementation that didn't get cleaned up. There are couple more occurrences that need to be addressed in this: https://github.com/nikhilk/scriptsharp/blob/cc/src/Core/Scripts/Runtime/Format.js

I will get to them, or feel free to change and submit a pull request, and I'll merge.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants