Question: Data numbers to money
See original GitHub issueJust a question here. My data array is money. I use accounting.js to convert to money.
var data = {
labels: ["January", "February", "March", "April", "May", "June", "July"],
datasets: [
{
label: "My First dataset",
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(54, 162, 235, 0.2)',
'rgba(255, 206, 86, 0.2)',
'rgba(75, 192, 192, 0.2)',
'rgba(153, 102, 255, 0.2)',
'rgba(255, 159, 64, 0.2)'
],
borderColor: [
'rgba(255,99,132,1)',
'rgba(54, 162, 235, 1)',
'rgba(255, 206, 86, 1)',
'rgba(75, 192, 192, 1)',
'rgba(153, 102, 255, 1)',
'rgba(255, 159, 64, 1)'
],
borderWidth: 1,
data: [65, 59, 80, 81, 56, 55, 40],
}
]
};
Let’s focus on the data array. I need to convert the numbers to money.
var a = accounting.formatMoney(65, "£", 2, ",", ".");
var b = accounting.formatMoney(59, "£", 2, ",", ".");
...
data: [a, b, ...] // This possible?
How to go about this? Is this a StackOverflow question? Thanks.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5
Top Results From Across the Web
Format numbers as currency - Microsoft Support
Display numbers as currency in your worksheet, and then read about differences between the Currency and Accounting formats.
Read more >Google | Phone | Currency Conversion - LeetCode Discuss
Question Paramenters: array of currency conversion rates. E.g. ['USD', 'GBP', 0.77] which means 1 USD is equal to 0.77 GBP; an array containing...
Read more >How to format numbers as currency strings - Stack Overflow
You will loose precision and data. You should store it as a integer number of cents (or pennies etc.) and then convert prior...
Read more >How to Format the Values of Numbers in a Pivot Table - Got It AI
Here's how to format values in a pivot table to get your data the way you want it. ... Post your problem and...
Read more >Please use the table below to answer the following questions ...
C = currency. D = demand deposits. ER = excess reserves. RR = required reserves. MB = monetary base. All numbers are in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Let your data be numbers and override the display (coffeescript syntax):
tooltips: callbacks: label: (tooltipItem, data) -> return ' ' + tooltipItem.yLabel + ' £'scales: yAxes: [ ticks: callback: (tick, index, ticks) -> return tick + ' £' ]@frlinw Yes. I had to use http://js2.coffee/ 😃 Thanks!