13,005,192 members (60,261 online)
Rate this:
See more:
```Double total = Convert.ToDouble(dt.Rows[0]["Amount_with_markup"]);
Double paid = Convert.ToDouble(txtpaid.Text);
Double rem =Math.Round(total - paid);
txtremaining.Text = rem.ToString(".####");```
Posted 14-Jan-13 6:06am
Sergey Alexandrovich Kryukov 14-Jan-13 15:43pm

I don't think you really need Round.
—SA

Rate this:

## Solution 1

Hi,

`.####` is max. 4 decimal places. Try `.0000` instead:
`txtremaining.Text = rem.ToString(".0000");`

Hope this helps.
ridoy 14-Jan-13 12:40pm

+5
ProgramFOX 14-Jan-13 12:41pm

Thank you!
Rate this:

## Solution 2

You can also handle only showing 4 decimal places in your Math.Round.

```Double total = Convert.ToDouble(20.04353450);
Double paid = Convert.ToDouble(19.25641654);
Double rem = Math.Round(total - paid, 4, MidpointRounding.AwayFromZero);
txtremaining.Text = rem.ToString();```
ridoy 14-Jan-13 12:40pm

+5

Top Experts
Last 24hrsThis month
 OriginalGriff 255 RickZeeland 120 Dave Kreskowiak 105 Richard Deeming 90 ppolymorphe 90
 OriginalGriff 5,170 ppolymorphe 2,617 RickZeeland 2,525 Kornfeld Eliyahu Peter 2,126 Richard Deeming 1,763