php - PHPOffice/PHPExcel PHPExcel_Style_NumberFormat FORMAT_CURRENCY_USD_SIMPLE correct way to use this. -
i trying use format_currency_usd_simple .
i able use dates, integer , general succefully. having problem this.
my cell content can this.
here can see, using "$75.00" cell content. putting $ cell content data query.
is content of cell value put in setcellvaluebycolumnandrow should without "$" or "$". have tried "$".
i have not tried without "$".
so correct content , correct format code.
i have used "format_currency_usd_simple" , "format_currency_usd" , '"$"#,##0.00_-' ( directly ) , '$#,##0_-' ( right ).
my currencny number $1,356.25. if follow structure.
which format code should use content value this.
my code , works date , numbers.
$areaofexcel = $column_alphabet.$row_start_data.":".$column_alphabet.$excel_current_row_index ; $this->excel_active_sheet->getstyle( $areaofexcel ) ->getnumberformat() ->setformatcode( $datatypefromadodb );
my main concern should correct format code or should correct content. use $ sign , format them properly.
the content value in cell should simple floating point number, no currency code, no thousands separator, etc..... should in ms excel if want use currency format number mask.
$value = 1234.56; // float value $objphpexcel->getactivesheet() ->setcellvalue('a1', $value); $objphpexcel->getactivesheet() ->getstyle('a1') ->getnumberformat() ->setformatcode(phpexcel_style_numberformat::format_currency_usd_simple);
Comments
Post a Comment