1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-11 08:30:55 +00:00
* Fixed: Emotes not appearing in Chat on Videos.
* Fixed: Extra, unnecessary `Pause Chat` section appearing in the Twitch chat settings menu.
* Fixed: Hide the number of unread whispers when hiding the whispers button.
* Fixed: The alternative live viewer display sometimes incorrectly displaying zero when loading the page.
* Fixed: Precision issue when displaying localized numbers in some cases.
This commit is contained in:
SirStendec 2020-09-15 19:17:29 -04:00
parent 943e0fdc18
commit 472f9472ee
8 changed files with 93 additions and 14 deletions

View file

@ -51,9 +51,9 @@ export const DEFAULT_TYPES = {
number(val, node) {
if ( typeof val !== 'number' ) {
let new_val = parseInt(val, 10);
let new_val = parseFloat(val);
if ( isNaN(new_val) || ! isFinite(new_val) )
new_val = parseFloat(val);
new_val = parseInt(val, 10);
if ( isNaN(new_val) || ! isFinite(new_val) )
return val;
@ -254,7 +254,16 @@ export default class TranslationCore {
formatNumber(value, format) {
let formatter = this.numberFormats.get(format);
if ( ! formatter ) {
formatter = new Intl.NumberFormat(this.locale, this.formats.number[format]);
if ( this.formats.number[format] )
formatter = new Intl.NumberFormat(this.locale, this.formats.number[format]);
else if ( typeof format === 'number' )
formatter = new Intl.NumberFormat(this.locale, {
minimumFractionDigits: format,
maximumFractionDigits: format
});
else
formatter = new Intl.NumberFormat(this.locale);
this.numberFormats.set(format, formatter);
}