(intermediate value).formatToParts is not a function
xe.com cannot convert currency
Moderator: trava90
Forum rules
Please always mention the name/domain of the website in question in your topic title.
Please one website per topic thread (to help keep things organized). While behavior on different sites might at first glance seem similar, they are not necessarily caused by the same.
Please try to include any relevant output from the Toolkit Error Console or the Developer Tools Web Console using the following procedure:
Please always mention the name/domain of the website in question in your topic title.
Please one website per topic thread (to help keep things organized). While behavior on different sites might at first glance seem similar, they are not necessarily caused by the same.
Please try to include any relevant output from the Toolkit Error Console or the Developer Tools Web Console using the following procedure:
- Clear any current output
- Navigate or refresh the page in question
- Copy and paste Errors or seemingly relevant Warnings into a single [ code ] block.
xe.com cannot convert currency
Upon load, the first page shows this error:
Re: xe.com cannot convert currency
Tell the webmaster?
Or just use a different website like fxexchange.com
Or just use a different website like fxexchange.com
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
Re: xe.com cannot convert currency
It seems Pale Moon doesn't actually have that function, though, but I haven't investigated particularly far beyond following an example on MDN.
Re: xe.com cannot convert currency
Yes it does! e.g.:
Code: Select all
var date = Date.UTC(2012, 11, 17, 3, 0, 42);
var formatter = new Intl.DateTimeFormat('en-us', {
weekday: 'long',
year: 'numeric',
month: 'numeric',
day: 'numeric',
hour: 'numeric',
minute: 'numeric',
second: 'numeric',
fractionalSecondDigits: 3,
hour12: true,
timeZone: 'UTC'
});
formatter.format(date);
// "Monday, 12/17/2012, 3:00:42.000 AM"
formatter.formatToParts(date);
// return value:
[
{ type: 'weekday', value: 'Monday' },
{ type: 'literal', value: ', ' },
{ type: 'month', value: '12' },
{ type: 'literal', value: '/' },
{ type: 'day', value: '17' },
{ type: 'literal', value: '/' },
{ type: 'year', value: '2012' },
{ type: 'literal', value: ', ' },
{ type: 'hour', value: '3' },
{ type: 'literal', value: ':' },
{ type: 'minute', value: '00' },
{ type: 'literal', value: ':' },
{ type: 'second', value: '42' },
{ type: 'fractionalSecond', value: '000' },
{ type: 'literal', value: ' ' },
{ type: 'dayPeriod', value: 'AM' }
]
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
Re: xe.com cannot convert currency
Well, it seems it's real. Then I don't know why it gave me an error when I tested it.
Re: xe.com cannot convert currency
Code: Select all
r=new Intl.NumberFormat('en-US',{style:"currency",currency:"USD"}).formatToParts(12345.6789);
/*
Exception: TypeError: (intermediate value).formatToParts is not a function
@Scratchpad/1:10:3
*/
Last edited by Kris_88 on 2021-03-25, 13:30, edited 1 time in total.
Re: xe.com cannot convert currency
https://developer.mozilla.org/en-US/doc ... matToParts
Code: Select all
var number = 3500;
var formatter = new Intl.NumberFormat('de-DE', {
style: 'currency',
currency: 'EUR'
});
formatter.format(number);
formatter.formatToParts(number);
/*
Exception: TypeError: formatter.formatToParts is not a function
@Scratchpad/1:16:1
*/
Last edited by Kris_88 on 2021-03-25, 13:30, edited 1 time in total.
Re: xe.com cannot convert currency
Off-topic:
Re: xe.com cannot convert currency
I sent them a message (since it seems nobody here so far did?)
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
Re: xe.com cannot convert currency
That's defunct, goes to a domain parking page now.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Re: xe.com cannot convert currency
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
Re: xe.com cannot convert currency
It's a shame they don't use URL parameters and force you to use the form on their page instead. I had created a multi parameter quicksearch for xe.com to convert currency and specify from and to currencies, now stuck until they fix their page.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Re: xe.com cannot convert currency
fxexchangerate.com uses subdomains.
e.g. for history at a certain date for a certain pair:
https:// {from} .fxexchangerate.com/ {to} - {ISO date} -exchange-rates-history.html
or to convert a certain amount directly:
https:// {from} .fxexchangerate.com/ {to} / {amount} -currency-rates.html
e.g. for history at a certain date for a certain pair:
Code: Select all
https://usd.fxexchangerate.com/sek-2021_02_28-exchange-rates-history.html
or to convert a certain amount directly:
Code: Select all
https://usd.fxexchangerate.com/eur/123.33-currency-rates.html
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
Re: xe.com cannot convert currency
Ah, didn't notice that. Thanks
"One hosts to look them up, one DNS to find them and in the darkness BIND them."
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Re: xe.com cannot convert currency
And what is the point?
Indeed, the developers of sites have a strange tendency to use the newest constructions to the detriment of compatibility. But this truck does not stop.
It is necessary either to add support for these functions into the browser or implement the mechanism of polyfills as a temporary solution.
Re: xe.com cannot convert currency
The point, my dear doomsayer, is that webmasters tend to not be aware of things if they are only testing in Chrome.
If we were to go by your attitude then we may as well all just pack up and leave and tell everyone to use Google Chrome because it happens to have the largest marketshare.
Also, this isn't even a web compat mismatch but looks like a genuine bug since we DO support the function it complains about.
So what's the point? Calling attention to a bug or, if not, to an accessibility issue if people can't view or use the site.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
Re: xe.com cannot convert currency
I am not doomsayer
Unfortunately you do NOT support the function Intl.NumberFormat.prototype.formatToParts().
You DO support Intl.DateTimeFormat.prototype.formatToParts().
https://tc39.es/ecma402/#sec-intl.numbe ... mattoparts
Re: xe.com cannot convert currency
Why is that even a thing?
Numbers aren't different depending on where you live 1000 is still 1000
But hey, patches are welcome.
Numbers aren't different depending on where you live 1000 is still 1000
But hey, patches are welcome.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite