
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
C# Exponential (“E”) Format Specifier
The ("E") format specifier converts a number to a string of the following form −
"-d.ddd…E+ddd"
Or
"-d.ddd…e+ddd"
Above, "d" is a digit (0-9).
Prefix the exponent with an "E" or an "e".
Example
using System; using System.Globalization; class Demo { static void Main() { double d = 3452.7678; Console.WriteLine(d.ToString("E", CultureInfo.InvariantCulture)); Console.WriteLine(d.ToString("E10", CultureInfo.InvariantCulture)); Console.WriteLine(d.ToString("e", CultureInfo.InvariantCulture)); Console.WriteLine(d.ToString("e10", CultureInfo.InvariantCulture)); } }
Output
3.452768E+003 3.4527678000E+003 3.452768e+003 3.4527678000e+003
- Related Questions & Answers
- C# Numeric (“N”) Format Specifier
- C# Fixed-Point (“F”) Format Specifier
- How to convert C# DateTime to “YYYYMMDDHHMMSS” format?
- C# Currency ("C") Format Specifier
- How to format number with “.” as thousand separators, and “,” as decimal separator?
- C# Hexadecimal ("X") Format Specifier
- C# Percent ("P") Format Specifier
- C# Decimal ("D") Format Specifier
- Header files “stdio.h” and “stdlib.h” in C
- C# Round-trip ("R") Format Specifier
- Sortable ("s") Format Specifier in C#
- Python Object Comparison “is” vs “==”
- Difference between “int main()” and “int main(void)” in C/C++?
- “extern” keyword in C
- “register” keyword in C
Advertisements