crackyourinterview.com


To improves our performance please Like Share Subscribe(Will boost us)


Main difference between ToString("D2") and ToString("00") or add prefix zero?
Question Posted on 22 Sep 2022Home >> DotNet >> C# >> Main difference between ToString("D2") and ToString("00") or add prefix zero?

Main difference between ToString("D2") and ToString("00") or add prefix zero?
To understand this we wil take a example of .ToString() method to convert value to string. Below is the example to do that

double d = 3.55123d;
int i = 4;
int j = 5;
Console.Write(i.ToString("D2"));
Console.Write(d.ToString("00"));
Console.Write(j.ToString("D2"));


Here in above code example first line will return "04" and second will also the same value "04" but third will return "05". So the difference in "00" and "D2" is "00" will handle the decimal and roundoff the result.
0
0




.


Most Visited Questions:-

Deep Learning Questions Answers
Below are the different Deep Leaning Questions and answer a More...

What is Gulpjs and some multiple choice questions on Gulp
Gulpjs is an open source whihc helps in building Javascript More...

Derived relationships in Association Rule Mining are represented in the form of __________.
Derived relationships in Association Rule Mining are repres More...

Continuous Integration Questions Answers
Below are the 20 odd questions for CI or Continuous Integra More...

Microservices Architecture Questions Answers
Below are the different questions on Microservices Architec More...




Other Important Questions

Simplest definition of partial classes and its rules?

Definition of Tuple class with some examples?

Define Race Condition in cSharp?

C#.Net Reserve Words

can we inherit private class level variables in c#






@2014-2022 Crackyourinterview (All rights reserved)
Privacy Policy - Disclaimer - Sitemap