---
title: "How can I convert string to decimal with trailing zero(s)"  
description: "How can I convert string to decimal with trailing zero(s)"  
author: "Anonymous User"  
published: 2013-10-05  
updated: 2013-10-05  
canonical: https://www.mindstick.com/forum/1608/how-can-i-convert-string-to-decimal-with-trailing-zero-s  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# How can I convert string to decimal with trailing zero(s)

Suppose that we have stringvalue=125.32600 when it [convert](https://www.mindstick.com/forum/2093/configurationmanager-appsettings-convert-n-to-n-why) to [decimal value](https://www.mindstick.com/forum/12664/how-to-round-decimal-value-in-gridview) with this [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii)

```
decimal d;
decimal.tryparse(stringvalue,out d)
```

\

d value is 125.326 how can I do this convert with final [result](https://www.mindstick.com/blog/12011/advantages-of-getting-result-oriented-seo-from-an-agency) 125.32600

## Replies

### Reply by Anonymous User

Your code works as written (as long as the [decimal](https://www.mindstick.com/forum/34709/please-write-a-program-for-decimal-to-binary-conversion-in-c-sharp) separator matches your culture):

```
decimal d;
decimal.TryParse("125.32600", NumberStyles.Number, CultureInfo.InvariantCulture, out d);
s = d.ToString(CultureInfo.InvariantCulture); // 125.32600
```

\

Decimal already remembers how many trailing zeros it has. This is caused by decimal representing numbers in non-normalized form, with an integer mantissa and an exponent representing the number of decimal digits. e.g. 125.32600 is represented as 12532600 * 10^-5


---

Original Source: https://www.mindstick.com/forum/1608/how-can-i-convert-string-to-decimal-with-trailing-zero-s

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
