question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Currency directive separators (European and Indian).

See original GitHub issue

Vue.js version

1.0.23

Reproduction Link

<div id="currencies">
    <br />{{currencies[0] | currency}}
    <br />{{currencies[1] | currency}}
    <br />{{currencies[2] | currency}}
    <br />{{currencies[0] | currency '&#8377;' 0}}
    <br />{{currencies[1] | currency '&#8377;' 0}}
    <br />{{currencies[2] | currency '&#8377;' 0}}
    <br />{{currencies[0] | currency '&#8364;'}}
    <br />{{currencies[1] | currency '&#8364;'}}
    <br />{{currencies[2] | currency '&#8364;'}}
    <br />{{currencies[0] | currency '&#8364;'}}
    <br />{{currencies[1] | currency '&#8364;'}}
    <br />{{currencies[2] | currency '&#8364;'}}
</div>
<script type="text/javascript">
var app = new Vue({
    el: '#currencies',
    data: { currencies: [10, 1000, 10000000] }
});
</script>

Steps to reproduce

What is Expected?

Indian numbering (as well as several other Asian countries) don’t use the same number separations as western countries. They place the first comma after three digits, and the rest every two digits, so large numbers like currencies become:

₹1,00,000

Instead of:

₹100,000

Further, many (but not all) European countries have a “decimal comma” and use a dot to separate thousands groups, so the equivalent large amount would become:

€100.000,00

I’m aware (from reading previous discussions on the | currency directive) that inferring settings from the currency marker is not desired, but there should be a way to specify the following outputs:

$10.00
$1,000.00
$10,000,000.00
₹10
₹1,000
₹1,00,00,000
€10.00
€1,000.00
€10,000,000.00
€10,00
€1.000,00
€10.000.000,00

Note the two different euro variants.

What is actually happening?

Currently, all the outputs are:

$10.00
$1,000.00
$10,000,000.00
₹10
₹1,000
₹10,000,000
€10.00
€1,000.00
€10,000,000.00
€10.00
€1,000.00
€10,000,000.00

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rpkilbycommented, Sep 8, 2016

@Y-Less Vue 2.0 is shipping w/o builtin filters. The best path forward is to create your own filter that uses a well-supported currency library to create the display value

0reactions
LinusBorgcommented, Sep 9, 2016

As @Y-Less mentioned, filters are removed in Vue 2.0, and we won’t add any new functionality to current filters, so this feature request won’t be fullfilled.

There are numerous libraries out there for formatting numbers to currency strings - Vue should not duplicate that behaviour again.

It’s pretty easy to create your own filter wrapper around one of those libraries, though with a custom filter

Read more comments on GitHub >

github_iconTop Results From Across the Web

International Currency Conversion - DFA Cornell
United States (U.S.) currency is formatted with a decimal point (.) as a separator between the dollars and cents. Some countries use a...
Read more >
Decimal separator - Wikipedia
A decimal separator is a symbol used to separate the integer part from the fractional part of a number written in decimal form...
Read more >
How to Format 30+ Currencies from Countries All Over the World
For example, countries in the European Union place the euro symbol to the right of the ... India Currency: Indian Rupee Abbreviation/Code: INR...
Read more >
How to show Indian Currency Format in Excel? - Chandoo.org
A permanent solution to Indian Number Formats:​​ Now in Excel the Default “,” and “$” Style will show the way you wanted.
Read more >
Angular Currency Pipe & Format Currency In Angular with ...
Indian rupee does not have symbol-narrow so the default rupee symbol displayed. If you want to display your own custom name as symbol...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found