Chapter 11



Recipe 11.1
Formatting a Date

Format a Date object.

Recipe 11.2
Formatting a Relative Date

Format another date relative to the current date.

Recipe 11.3
Formatting Numbers

Format a number to provide locale-specific decimal and thousands separators.

Recipe 11.4
Rounding Decimal Places

Round a number to a fixed number of decimal places.

Recipe 11.5
Formatting a Price Range

Print a price range calculated from an array of prices.

Recipe 11.6
Formatting Measurement Units

Format measurement units.

Recipe 11.7
Applying Pluralization Rules

Format a message differently depending on the number of items.

Recipe 11.8
Counting Characters, Words, and Sentences

Split up a string into locale-specific segments to count words and sentences.

Recipe 11.9
Formatting Lists

Combine strings together into a locale-specific list format.

Recipe 11.10
Sorting an Array of Names

Apply locale-specific logic to compare strings when sorting an array of names.

Web Browser API Cookbook
Joe Attardi