Working with Currency Properties in PHP
Aspose.Tasks - Reading Currency Properties
To read Currency Properties using Aspose.Tasks Java for PHP, call get_currency_properties method of CurrencyProperties module. Here you can see example code.
PHP Code
1$project = new Project('test_tasks.mpp');
2
3$prj = new Prj();
4
5print "Currency Code : " . (string)$project->get($prj->CURRENCY_CODE);
6
7print "\nCurrency Digits : " . (string)$project->get($prj->CURRENCY_DIGITS);
8
9print "\nCurrency Symbol : " . (string)$project->get($prj->CURRENCY_SYMBOL);
10
11print "\nCurrency Symbol Position: ". (string)$project->get($prj->CURRENCY_SYMBOL_POSITION);
Aspose.Tasks - Writing Currency Properties
To write Currency Properties using Aspose.Tasks Java for PHP, call set_currency_properties method of CurrencyProperties module. Here you can see example code.
PHP Code
1$project = new Project();
2
3$prj = new Prj();
4
5$currencySymbolPositionType = new CurrencySymbolPositionType();
6
7$project->set($prj->CURRENCY_CODE, "AUD");
8
9$project->set($prj->CURRENCY_DIGITS, 2);
10
11$project->set($prj->CURRENCY_SYMBOL, "$");
12
13$project->set($prj->CURRENCY_SYMBOL_POSITION, $currencySymbolPositionType->After);
14
15$saveFileFormat = new SaveFileFormat();
16
17$project->save("currency_properties.xml", $saveFileFormat->XML);
18
19print "Set currency properties, please check the output file.";
Download Running Code
Download Currency Properties (Aspose.Tasks) from any of the below mentioned social coding sites: