Currency Properties in Ruby

Aspose.Tasks - Reading Currency Properties

To read Currency Properties using Aspose.Tasks Java for Ruby, call get_currency_properties method of CurrencyProperties module. Here you can see example code.

Ruby Code

1project = Rjb::import('com.aspose.tasks.Project').new('test_tasks.mpp')
2prj = Rjb::import('com.aspose.tasks.Prj')
3puts "Currency Code : " + project.get(prj.CURRENCY_CODE).toString()
4puts "Currency Digits : " + project.get(prj.CURRENCY_DIGITS).toString()
5puts "Currency Symbol : " + project.get(prj.CURRENCY_SYMBOL).toString()
6puts "Currency Symbol Position: " + project.get(prj.CURRENCY_SYMBOL_POSITION).toString()

Aspose.Tasks - Writing Currency Properties

To write Currency Properties using Aspose.Tasks Java for Ruby, call set_currency_properties method of CurrencyProperties module. Here you can see example code.

Ruby Code

1project = Rjb::import('com.aspose.tasks.Project').new
2prj = Rjb::import('com.aspose.tasks.Prj')
3project.set(prj.CURRENCY_CODE, "AUD")
4project.set(prj.CURRENCY_DIGITS, 2)
5project.set(prj.CURRENCY_SYMBOL, "$")
6project.set(prj.CURRENCY_SYMBOL_POSITION, Rjb::import('com.aspose.tasks.CurrencySymbolPositionType').After)
7project.save("currency_properties.xml", Rjb::import('com.aspose.tasks.SaveFileFormat').XML)
8puts "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:

Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.