×
Namespaces

Variants
Actions
(Difference between revisions)

Archived:Internationalising currencies in Symbian C++

From Nokia Developer Wiki
Jump to: navigation, search
hamishwillee (Talk | contribs)
m (Hamishwillee - Bot fixing redirect link.(Moving links from forum.nokia.com TO developer.nokia.com))
hamishwillee (Talk | contribs)
m (Hamishwillee - Bot change of template (Template:CodeSnippet) - now using Template:ArticleMetaData)
Line 2: Line 2:
 
__NOEDITSECTION__
 
__NOEDITSECTION__
 
{{KBCS}}
 
{{KBCS}}
{{CodeSnippet
+
{{ArticleMetaData
 
|id=CS000856
 
|id=CS000856
 
|platform=S60 3rd Edition, MR<br />S60 3rd Edition, FP1<br />S60 3rd Edition, FP2 Beta
 
|platform=S60 3rd Edition, MR<br />S60 3rd Edition, FP1<br />S60 3rd Edition, FP2 Beta
Line 10: Line 10:
 
|creationdate=March 25, 2008
 
|creationdate=March 25, 2008
 
|keywords=TLocale, TLocale::FormatCurrency()
 
|keywords=TLocale, TLocale::FormatCurrency()
 +
 +
|sourcecode= <!-- Link to example source code (e.g. [[Media:The Code Example ZIP.zip]]) -->
 +
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
 +
|sdk=<!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) -->
 +
|devicecompatability=<!-- Compatible devices (e.g.: All* (must have GPS) ) -->
 +
|signing=<!-- Empty or one of Self-Signed, DevCert, Manufacturer -->
 +
|capabilities=<!-- Capabilities required (e.g. Location, NetworkServices. -->)
 +
|author=[[User:Tapiolaitinen]]
 
}}
 
}}
  

Revision as of 11:19, 24 June 2011


Template:KBCS

Article Metadata
Tested with
Devices(s): Nokia E61i
Nokia E90 Communicator
Nokia N95 8GB
Nokia 6220 Classic
Compatibility
Platform(s): S60 3rd Edition, MR
S60 3rd Edition, FP1
S60 3rd Edition, FP2 Beta
S60 3rd Edition (initial release)
Platform Security
Capabilities: )
Article
Keywords: TLocale, TLocale::FormatCurrency()
Created: tapiolaitinen (25 Mar 2008)
Last edited: hamishwillee (24 Jun 2011)

Overview

This code snippet is one of the series of snippets that demonstrate how to implement support for international diversity. This snippet shows how to format currency according to the locale settings of the device.

Source file

// Buffer for localized text
TBuf<50> myBuf;
 
// The amount is an integer, but it is treated as if the last two digits
// were decimal digits. E.g. 1249 = 12.49, 2 = 0.02, 002 = 0.02 ...
TInt myAmount = 123456789;
 
// Locale is initialized with system's current locale settings
TLocale myLocale;
 
// Format currency according to current locale settings
myLocale.FormatCurrency(myBuf, myAmount);

Postconditions

Currency is formatted according to the locale settings of the device.

See also

112 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×