Skip to content

Commit

Permalink
Merge pull request #155 from c84c/localized_numbers
Browse files Browse the repository at this point in the history
Localized number format
  • Loading branch information
hedayaty authored May 12, 2023
2 parents 20a637c + d58a260 commit 3272732
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net_speed.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ var NetSpeed = class NetSpeed {
m_digits -= 2;
else if (amount >= 10)
m_digits -= 1;

return {
text: amount.toFixed(m_digits - 1),
text: amount.toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: m_digits - 1 }),
unit: (this.use_bytes ? byte_speed_map : bit_speed_map)[unit]
};
}
Expand Down

0 comments on commit 3272732

Please sign in to comment.