Managing Currency Symbols
Overview
The currency symbol defines how monetary values are visually represented in a Microsoft Project file.
For example:
$
for US dollars€
for euros¥
for Japanese yen₴
for Ukrainian hryvnia
In Aspose.Tasks, this is managed via the
CurrencySymbol
property of the
Project
class.
Managing Currency Symbols
The CurrencySymbol property exposed by the Project class is used to set or get the currency symbol. This property supports the string data type.
To view or change the currency symbol in Microsoft Project:
- From the Tools menu, select Options.
- Go to the View tab.
- The Currency symbol field shows the currently selected symbol.
Viewing the currency symbol in Microsoft Project
Figure: Changing the currency symbol in Microsoft Project.
Working with Currency Symbols in Aspose.Tasks
The CurrencySymbol
property is a string that holds the symbol to be displayed before or after currency values in a project.
It works together with:
CurrencyCode
— ISO 4217 currency code.CurrencySymbolPosition
— Where to place the symbol.CurrencyDigits
— Decimal places for currency values.
Setting Currency Symbol using Aspose.Tasks
The following example shows how to set a currency symbol for a project.
1// Create new project and set currency symbol
2Project project = new Project();
3project.Set(Prj.CurrencySymbol, "$$");
Notes:
You can use any string as a currency symbol (including multi-character strings like US$
).
Symbols should be consistent with the CurrencyCode
to avoid confusion in reports.
Getting Currency Symbol using Aspose.Tasks
Access the currency symbol using a project’s CurrencySymbol:
1Project project = new Project("New Project.mpp");
2Console.WriteLine(project.Get(Prj.CurrencySymbol));
Best Practices
- ✅ Match the symbol with the correct
CurrencyCode
(e.g.,$
+ USD,€
+ EUR). - ✅ Use standard Unicode currency symbols for proper cross-platform display.
- ✅ Adjust
CurrencySymbolPosition
for correct placement in your locale. - ❌ Avoid using symbols unrelated to the currency code (e.g.,
$
with EUR) unless specifically required.
Related API Members
CurrencyCode
— Three-letter ISO 4217 currency code.CurrencyDigits
— Decimal precision for currency values.CurrencySymbolPosition
— Placement of the symbol.
FAQ
Q: Can I use multi-character currency symbols?
A: Yes. For example, US$
or CAD$
can be used if desired.
Q: Does changing the symbol affect numeric calculations?
A: No. It only changes how values are displayed, not their stored values.
Summary
The currency symbol in Aspose.Tasks for .NET controls how monetary values are displayed in project files. You can:
- View it directly in MS Project or via
CurrencySymbol
. - Set it to match your reporting or localization needs.
- Combine it with
CurrencyCode
,CurrencyDigits
, andCurrencySymbolPosition
for full control over currency formatting.