Welcome Guest, Not a member yet? Register   Sign In
how to convert array value to int
#1

I need to fill out the array below in order to get this library working. The two values that are in question are "value" and "baseValue". When I hard code the number 3 and the number 5 into these two it works fine. But my code below doesn't work. I tried casting both values to (int) but that didn't work either.


\koolreport\amazing\ProgressCard::create(array(
       
"title"=>"Percent Complete",
       
"infoText"=>"Three Way Risk Analysis",
       
"value"=>$this->dataStores['global_summary']['rows'][0]['num_titles_complete'],  //completed rows
        "preset"=>"primary",
       
"baseValue"=>$this->dataStores['global_summary']['rows'][0]['num_titles'],  //number of rows
        "format"=>array(
           
"value"=>array(
               
"prefix"=>"complete"
            ),
           
"indicator"=>array(
               
"decimals"=>2
            )
        ),
       
"cssClass"=>array(
           
"icon"=>"fa fa-euro"
        ),
    ));
proof that an old dog can learn new tricks
Reply
#2

Solved. The proper way to get the value is

"value"=>$this->dataStore("global_summary")->get(0,"num_titles"),
proof that an old dog can learn new tricks
Reply
#3

You can also cast the value (int) $somevalue
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB