• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Convert Decimal To String C#

Resolved: Convert Decimal To String C#

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

How can i convert decimal to string without rounding and with specific format?
It is my value;
I want to this result result = "4.569,99" . I can check to culture for seperators like this
I try some codes
My value can be any value. I just want to seperate with specific format and seperate two digit after comma and not rounding when convert to string.

Answer:

Having unwanted digits after the decimal point you have to round the value, the question is how to round it. In your case it seems that you want to truncate (4569.996 -> 4569.99), i.e. round to zero:
Or

If you have better answer, please add a comment about this, thank you!

.net-core c# decimal string type-conversion
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: std::regex_replace to replace multiple combinations

26/03/2023

Resolved: How can I copy files using the ansible.builtin.copy module and avoid conflicting file names?

26/03/2023

Resolved: Reshape tensors of unknown shape with tf.function

26/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.