Apple Newton Utilities Guide de l'utilisateur Page 745

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 942
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 744
CHAPTER 20
Localizing Newton Applications
Using the Localization Features of the Newton 20-13
// get the current time
theTime:= Time();
// pass the time and the format to LongDateStr
LongDateStr(theTime,kmyDateSpec);
This example is deliberately verbose for purposes of illustrating how to build a
format specication array.
The kIncludeAllElements Constant 20
If you want to use the default format for time or date strings as specied by the
active locale bundle, you can pass the
kIncludeAllElements constant to the
functions
LongDateStr, ShortDateStr, and TimeStr. You’ll get the results
summarized inTable 20-1.
Currency Values 20
Currency strings reect localized formatting characteristics that distinguish them
from other number strings. They
typically display a prex or sufx indicating their denomination
may require an additional prex and/or sufx that indicates whether the amount
is negative.
Currency strings must also adhere to regional conventions for
grouping numbers
the delimiter that indicates these groupings
the character that represents the decimal point
These values are stored in a frame in the active locale bundle’s numberFormat slot.
For example, the
currencyPrefix slot stores the value "$" for the U.S. locale
and
"£" for the United Kingdom locale, while in the French Canadian locale, the
currencyPrefix slot has no value and the currencySuffix slot stores the
value
"$".
Table 20-1 Using the kIncludeAllElements constant
Function Format of output
LongDateStr
day of week, month, day, year in locale’s default format
ShortDateStr
year, month, day in locale’s default short date format
TimeStr
hour, minute, second, AM/PM, and sufx
Vue de la page 744
1 2 ... 740 741 742 743 744 745 746 747 748 749 750 ... 941 942

Commentaires sur ces manuels

Pas de commentaire