About 17,900,000 results
Open links in new tab
  1. c# Correct way to convert string value to decimal

    Nov 17, 2017 · I'd generally recommend using the static Parse methods over Convert.ToXyz (as they're often more capable, and have TryParse options too), so while you could pass the …

  2. c# - How do I convert string to decimal? - Stack Overflow

    I suspect you're using a culture that defines . as the thousands separator and , as the decimal separator. If you want to force , and . as the thousands and decimal separators, respectively …

  3. Convert.ToDecimal Method (System) | Microsoft Learn

    Converts the specified string representation of a number to an equivalent decimal number, using the specified culture-specific formatting information. Converts the value of the specified 64-bit …

  4. C# | Convert.ToDecimal(String, IFormatProvider) Method

    Aug 29, 2021 · This method is used to convert the specified string representation of a number to an equivalent decimal number, using the specified culture-specific formatting information. …

  5. c# - How do I convert a string to a decimal, and format it for …

    Jul 21, 2011 · The overload of decimal.Parse that takes an IFormatProvider will allow you to parse strings containing numbers with periods as decimal point symbols (in case the standard is a …

  6. How to convert a string to a number - C# | Microsoft Learn

    Dec 19, 2024 · You convert a string to a number by calling the Parse or TryParse method found on numeric types (int, long, double, and so on), or by using methods in the System.Convert class.

  7. How to Cast a String to Decimal in C# - Web Dev Tutor

    Jul 22, 2024 · Casting a string to a decimal in C# is a common operation that can be done using various methods like Decimal.Parse() and Decimal.TryParse(). By understanding these …

  8. Converting a String to Decimal in C# - Web Dev Tutor

    Jul 22, 2024 · One of the safest ways to convert a string to a decimal in C# is by using the Decimal.TryParse() method. This method attempts to parse the input string and returns a …

  9. How to convert a string to a decimal in C# - Educative

    Converting a string to a decimal value or decimal equivalent can be done using the Decimal.TryParse() method. It converts the string representation of a number to its decimal …

  10. c# - Convert string value into decimal with proper decimal

    Apr 10, 2015 · string getnumber = "11.10"; decimal decinum = Math.Round(Convert.ToDecimal(getnumber), 2);

  11. Some results have been removed
Refresh