×
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)
extkbeditor1 (Talk | contribs)
m
Line 2: Line 2:
 
__NOEDITSECTION__
 
__NOEDITSECTION__
 
{{KBCS}}
 
{{KBCS}}
{|style="background:#eceff2" width="660px" border="1" cellpadding="5" cellspacing="0"
+
{{CodeSnippet
|-
+
|id=CS000856
|'''ID''' || CS000856
+
|platform=S60 3rd Edition, MR<br />S60 3rd Edition, FP1<br />S60 3rd Edition, FP2 Beta
|'''Creation date''' || March 25, 2008
+
|devices=Nokia E61i<br />Nokia E90 Communicator<br />Nokia N95 8GB<br />Nokia 6220 Classic
|-
+
|category=Symbian C++
|'''Platform''' || S60 3rd Edition, MR<br />S60 3rd Edition, FP1<br />S60 3rd Edition, FP2 Beta
+
|subcategory=Localization
|'''Tested on devices''' || Nokia E61i<br />Nokia E90 Communicator<br />Nokia N95 8GB<br />Nokia 6220 Classic
+
|creationdate=March 25, 2008
|-
+
|keywords=TLocale, TLocale::FormatCurrency()
|'''Category''' || Symbian C++
+
}}
|'''Subcategory''' || Localization
+
|-
+
|'''APIs''' || None
+
|'''Classes''' || TLocale
+
|-
+
|'''Methods''' || TLocale::FormatCurrency()
+
|&nbsp; || &nbsp;
+
|}
+
  
 
==Overview==
 
==Overview==

Revision as of 21:03, 8 October 2008


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)
Article
Keywords: TLocale, TLocale::FormatCurrency()
Created: (25 Mar 2008)
Last edited: extkbeditor1 (08 Oct 2008)

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

67 page views in the last 30 days.
×