Using the Locale Identifier (LCID) (1)

Source: Internet
Author: User
Tags locale locale setting
Introduction:
When to use the VBScript functions FormatNumber, FormatDateTime, and FormatCurrency, the output displayed is based upon T He regional settings of your WEB server. (To learn more about this functions check out the technical docs (FormatCurrency | FormatDateTime | FormatNumber) or this FAQ.) For example, if your have your regional settings to english-united States, when running the following code from an ASP PA Ge

Response.Write FormatNumber (123456789) & "<br>"
Response.Write FormatCurrency (987654321)


You'll get the following output:
123,456,789.00
$987,654,321.00

Note this both include two digits after the decimal by default, which set of three digits to the "left" of the decimal place is grouped by a comma, and that's the decimal place are represented by a period. While the US visitors may is accustomed to this format, many Europeans are more familiar and a system that uses spaces D of commas and commas instead of periods.

For example, someone from France is more comfortable with the following output:
123 456 789,00
987 654 321,00 F

Of course, due to exchange rates, 987,654,321 francs and 876,654,321 dollars are not equivalent, but a visitor from France Would, most likely, prefer to "monetary rates in their natural.

Regional Settings:
The values FormatNumber and FormatCurrency functions output is customizable, based on the regional settings of the Web ser Ver. To alter the WEB server's regional settings you need to have Administrator access to the machine itself. Start by opening the Control Panel (Start/settings/control panel) and double click on the regional Options icon. This would open a dialog box similar to the one below. In the I tab, you can select the Web server ' s default locale setting. There are a plethora of locales you can select, all of them highly.



Take a moment to examine the dialog Box:notice this there are tabs for the Numbers, Currency, and Date with for the S elected locale. These settings are are all customizable. So, if your chose your locale to be 中文版 (United States) but wanted to, by default, show four digits after the decimal p Lace, you are could move over to the Numbers tab and do this option. The screenshot below is of the Numbers tab showing all of the settings can be specify for the selected.



While specifying a default locale setting, which inherently effects the output of VBScript ' s Format functions, are useful a nd handy, what if we want to, for some the users or for some occassions, use a different locale? How can we accomplish this? We'll examine exactly how to using the LCID property of the "Session Object", part 2.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.