The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Comma separator while retrieving cpanel account data with api

Discussion in 'cPanel Developers' started by falkor, Feb 11, 2014.

  1. falkor

    falkor Registered

    Joined:
    Aug 12, 2006
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    I am using the code below to retreive cpanel account data:

    include("cpanel.php");

    $ip="127.0.0.1";
    $port=2083;

    $account='some-account';
    $passwd='some-password';

    $xmlapi=new xmlapi($ip);
    $xmlapi->password_auth($account,$passwd);
    $xmlapi->set_port($port);

    $call=array('display' => 'diskusage|bandwidthusage');
    $result=$xmlapi->api2_query($account,'StatsBar','stat',$call);

    $diskusage=$result->data[0]->count;
    $bandwidthusage=$result->data[1]->count;

    echo $diskusage; // and I get: 25,274,9
    echo $bandwidthusage; // and I get: 10,477,08

    The problem is I am getting comma as thousands separator
    and also comma as decimal point.
     
  2. morissette

    morissette Well-Known Member

    Joined:
    May 24, 2009
    Messages:
    119
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Austin, TX
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page