Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8920973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:24:54+00:00 2026-06-15T06:24:54+00:00

I´m trying to parse a String to a Decimal but I keep getting a

  • 0

I´m trying to parse a String to a Decimal but I keep getting a formatException

Dim row as GridViewRow
    for each row in grdActieRittenActiefAlt.rows
        Dim rbl as RadioButtonList = row.FindControl("tblAddAct")
        'toevoegen = true
        if rbl.SelectedItem.Value = true then
            Dim opgaveIdent as Integer = Convert.ToInt32(grdActieRittenActiefAlt.DataKeys(row.RowIndex).Value.ToString())

            Dim curOldTarief as Decimal = Convert.ToDecimal(lblCuratiefTarief.Text)
            Dim curOldKorting as Decimal = Convert.ToDecimal(lblCuratiefKorting.Text)

            Dim curTariefString as String = row.Cells(4).Text
            Dim curKortingString as String = row.Cells(6).Text

            Dim curTarief as Decimal = Convert.ToDecimal(curTariefString)
            Dim curKorting as Decimal = Convert.ToDecimal(curKortingString)

            lblCuratiefTarief.Text = (curOldTarief + curTarief).ToString()
            lblCuratiefKorting.Text = (curOldKorting + curKorting).ToString()


        end if
    next row

The input is 431,25.

So far I’ve tried the following:

  • Changing the comma to a colon using .Replace(“,”,”.”) => Didn’t work
  • Using a forced CultureInfo => Didn’t work
  • Use the row.Cells(4).Text directly => Didn’t work
  • Use a substring query to get only the round numbers (431) => Worked but is no solution
  • Does anyone else have any suggestions?

    • 1 1 Answer
    • 0 Views
    • 0 Followers
    • 0
    Share
    • Facebook
    • Report

    Leave an answer
    Cancel reply

    You must login to add an answer.

    Forgot Password?

    Need An Account, Sign Up Here

    1 Answer

    • Voted
    • Oldest
    • Recent
    • Random
    1. Editorial Team
      Editorial Team
      2026-06-15T06:24:56+00:00Added an answer on June 15, 2026 at 6:24 am

      After doing a lot more testing and trying I’ve found a workaround/solution for the problem.

      The row.Cells(4).Text was a boundfield. I’ve changed that to a TemplateField with a label.
      By making a local variable (Label) and using that to convert the decimal from it works. I got no idea why but for me it’s a solution for now.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
        • Report

    Sidebar

    Related Questions

    Im trying to parse a String thats a date 2012-07-15T20:55:33+00:00, however I keep getting
    I am getting an error when trying to parse a string to datetime. I
    I am getting the strangest error, when trying to parse a string as a
    I'm trying to parse a string to a decimal and the parsing should failed
    I'm trying to parse a String that represents a date using GMT, but it
    I am trying to parse a string like $45.59 into a decimal. For some
    I am trying to parse or convert a string to decimal in C#. I
    I'm trying to convert a string of characters into each characters decimal form and
    I am trying to parse string 0.0000 with double.TryParse() but I have no idea
    Im trying to parse the string located in /proc/stat in a linux filesystem using

    Explore

    • Home
    • Add group
    • Groups page
    • Communities
    • Questions
      • New Questions
      • Trending Questions
      • Must read Questions
      • Hot Questions
    • Polls
    • Tags
    • Badges
    • Users
    • Help
    • SEARCH

    Footer

    © 2021 The Archive Base. All Rights Reserved
    With Love by The Archive Base

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.