c# - how to return double from double plus double? -


i hava 2 double variables, , when sum them return me int variable. want return double too. should do? thank you!

example:

double d = 4.0; double myd = 4.0;   console.writeline ( d+myd ); // returns me 8 want 8.0 . 

the value 8 , 8.0 same. if want decimals shown in results, use converter n2 fixed 2 sigdig after decimal.

console.writeline((d+myd).tostring("n2")); 

Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -