O'Reilly logo

Microsoft® .NET Compact Framework (Core Reference) by Mark Sutton, Rory MacLoed, Robert Burbidge, Stephen Wheelwright, Andy Wigley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Formatting Strings for Output

The .NET Compact Framework provides you with comprehensive facilities to format strings for output. In this section, you’ll see how to format various data types, including numeric types, date/time types, and enumerated types. You’ll also see how to provide culture-specific formatting.

Understanding Concepts and Terminology

This first section contains a brief introduction to concepts in .NET Compact Framework formatting, which involves format specifiers, format specifications, and format providers. In the following code fragment

double amount = 10.0/3.0;
string myString = amount.ToString("F4");

the string "F4" is a format specifier and specifies that the value amount is to be formatted as fixed-point (F) with 4 digits ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required