×
Namespaces

Variants
Actions
(Difference between revisions)

Archived:Internationalising currencies in Symbian C++

From Nokia Developer Wiki
Jump to: navigation, search
Forum Nokia KB (Talk | contribs)
hamishwillee (Talk | contribs)
m (Hamishwillee - Bot update - Fix links)
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
__NOTOC__
+
{{Archived|timestamp=20120314041402|user=roy.debjit| }}
__NOEDITSECTION__
+
[[Category:Symbian C++]][[Category:Code Snippet]][[Category:Localization]][[Category:S60 3rd Edition (initial release)]][[Category:Code Snippet]]
{{KBCS}}
+
{{ArticleMetaData <!-- v1.2 -->
{|style="background:#eceff2" width="660px" border="1" cellpadding="5" cellspacing="0"
+
|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]]) -->
|'''ID''' || CS000856
+
|devices= Nokia E61i<br />Nokia E90 Communicator<br />Nokia N95 8GB<br />Nokia 6220 Classic
|'''Creation date''' || March 25, 2008
+
|sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) -->
|-
+
|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
+
|devicecompatability= <!-- Compatible devices (e.g.: All* (must have GPS) ) -->
|'''Tested on devices''' || Nokia E61i<br />Nokia E90 Communicator<br />Nokia N95 8GB<br />Nokia 6220 Classic
+
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->
|-
+
|signing= <!-- Empty or one of Self-Signed, DevCert, Manufacturer -->
|'''Category''' || Symbian C++
+
|capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
|'''Subcategory''' || Localization
+
|keywords= TLocale, TLocale::FormatCurrency()
|-
+
|language= <!-- Language category code for non-English topics - e.g. Lang-Chinese -->
|'''APIs''' || None
+
|translated-by= <!-- [[User:XXXX]] -->
|'''Classes''' || TLocale
+
|translated-from-title= <!-- Title only -->
|-
+
|translated-from-id= <!-- Id of translated revision -->
|'''Methods''' || TLocale::FormatCurrency()
+
|review-by= <!-- After re-review: [[User:username]] -->
|&nbsp; || &nbsp;
+
|review-timestamp= <!-- After re-review: YYYYMMDD -->
|}
+
|update-by= <!-- After significant update: [[User:username]]-->
 +
|update-timestamp= <!-- After significant update: YYYYMMDD -->
 +
|creationdate= 20080304
 +
|author= [[User:Tapiolaitinen]]
 +
<!-- The following are not in current metadata -->
 +
|subcategory= Localization
 +
|id= CS000856
 +
}}
  
 
==Overview==
 
==Overview==
Line 47: Line 54:
 
==See also==
 
==See also==
  
* [[CS000855 - I18n: Real numbers]]
+
* [[Archived:Internationalising real numbers in Symbian C++]]
* [[CS000857 - I18n: Timestamps]]
+
* [[Internationalising timestamps in Symbian C++]]
* [[CS000858 - I18n: Images]]
+
* [[Archived:Internationalising images on Symbian C++]]
* [[CS000807 - Localizing_application_strings]]
+
* [[Localizing strings on Symbian C++ apps]]
* [http://www.forum.nokia.com/info/sw.nokia.com/id/1c82873d-183e-4073-afdb-22e09a5dc8c5/S60_Platform_Localization_Example_v1_0_en.zip.html S60 Platform: Localization Example]
+
* [http://www.developer.nokia.com/info/sw.nokia.com/id/1c82873d-183e-4073-afdb-22e09a5dc8c5/S60_Platform_Localization_Example_v1_0_en.zip.html S60 Platform: Localization Example]
 
+
[[Category:Symbian C++]][[Category:Code Examples]][[Category:Localization]][[Category:S60 3rd Edition]]
+

Latest revision as of 08:12, 29 June 2012

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

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)
Article
Keywords: TLocale, TLocale::FormatCurrency()
Created: tapiolaitinen (04 Mar 2008)
Last edited: hamishwillee (29 Jun 2012)

Contents

[edit] 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.

[edit] 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);

[edit] Postconditions

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

[edit] See also

This page was last modified on 29 June 2012, at 08:12.
114 page views in the last 30 days.
×