Home Forums Report Bugs format currency

format currency

Viewing 8 posts - 1 through 8 (of 8 total)
  • #21915

    Hello, I use the br culture and I’m trying to format the value: 114307653.79 (114,307,653.79) and it shows more than two decimal places – 114,307,653,7900,0001.

    What do I do ?

    Thank you.

    #21916

    114.307.653,79 and not 114.307.653,79000001

    thanks.

    #21925

    @gussmarcaro,

    Setting valueFormatSting to ‘#,##0.00’ seems to be working fine with the y-value that you have shared (114307653.79).
    Column Chart - Formatting axis label

    Can you kindly create jsfiddle reproducing the issue you are facing, so that we can look into your code, understand it better and help you out?


    Vishwas R
    Team CanvasJS

    #21932

    Hello, thank you for replying.

    Verify that they are not two decimal places.

    Thank you.
    Follow the code.

    var chart = new CanvasJS.Chart(“chartContainer”,
    {
    data: [
    {
    type: “column”,
    valueFormatSting: “#, ## 0.00”,
    dataPoints: [
    { x: 10, y: 710000000.69 },
    { x: 20, y: 55 },
    { x: 30, y: 50 },
    { x: 40, y: 65 },
    { x: 50, y: 95 },
    { x: 60, y: 68 },
    { x: 70, y: 28 },
    { x: 80, y: 34 },
    { x: 90, y: 14 }
    ]
    }
    ]
    });

    chart.render();

    #21934

    Please note tooltip hint

    Thanks.

    #21938

    @gussmarcaro,

    valueFormatString formats the labels appearing on axisY. To format the y-values that appear in toolTip / indexLabel, you should use yValueFormatString. Setting yValueFormatSting to ‘#,##0.00’ should work fine in your case. Please refer documentation on yValueFormatString for more info and formatting options available for the same.
    Formatting Numbers

    It would be helpful for us to understand your scenario better when we look at your working code live in jsfiddle. So I request you to create jsfiddle and share it with us, rather than pasting code, if you are still facing any issue.


    Vishwas R
    Team CanvasJS

    #21949

    thank you.
    This is the code

    var chart = new CanvasJS.Chart(“chartContainer”,
    {
    data: [
    {
    type: “column”,
    dataPoints: [
    { x: 10, y: 7100000000.69 },
    { x: 20, y: 55 },
    { x: 30, y: 50 },
    { x: 40, y: 65 },
    { x: 50, y: 95 },
    { x: 60, y: 68 },
    { x: 70, y: 28 },
    { x: 80, y: 34 },
    { x: 90, y: 14 }
    ]
    }
    ],

    AxisY:{
    ValueFormatString: “#,## 0.00”
    }

    });

    chart.render();

    #21950

    It worked! Thanks for listening.

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.