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

  • SEARCH
  • Home
  • 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 9107583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:36:27+00:00 2026-06-17T02:36:27+00:00

I have a field in db named ‘loss’ which is of type float. Here

  • 0

I have a field in db named ‘loss’ which is of type float.

Here is how I save it in db:

[HttpPost]
public int SaveLoss(float loss)
{
   var t = (from x in db.tblTest
            where x.id == 8
            select x).First();
   t.loss = loss; //also tried t.loss = loss / 1;
   db.SaveChanges(); //entity framework
 }

This is how I always work and in all the other tables it works fine.

I enter the loss via a textbox and here is the Ajax call:

$.ajax({
    type: "POST",
    url: "/Test/SaveLoss",
    data: {
        loss: parseFloat($('#myTextbox').val().replace(',', '.'))
    }
    ....

If in the textbox I enter 66.55, everything works great. If in the textbox I enter 66,55, the value stored in db is 6655. This issue doesn’t happen on my computer. When I publish the application on server, it occurs. Why is this annoying issue happening and how to fix it?

Fiddler says that 66.55 is input parameter of SaveLoss.

  • 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-17T02:36:28+00:00Added an answer on June 17, 2026 at 2:36 am

    It looks like either the browser or server has a different number format, perhaps it is running in a culture where ‘,’ is used as a decimal separator and ‘.’ as a thousands separator.

    You could try setting Thread.CurrentThread.CurrentCulture to CultureInfo.InvariantCulture after starting the server or before running the database query.

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

Sidebar

Related Questions

I have a field variable named uid in a class. The type is int,
i have table called as Support, which have a field named Name and contains
i have a nvarchar(max) field named PublishTime, which contains the time in HH:MMtt (10:20AM),
I have a field (named as time, but type is TEXT) in my Sqlite
I have a field named VALUE of VARCHAR2 type The string is in this
In a SQL Server table, I have a field named Timestamp, which is a
I have a database of person documents. Each has a field named photos, which
I have a field named 'SALARY ON' in which data(year-month) entered is in format
In my MySQL database, I have a float field named HoursSpent with values like
I have some tables which all have a field named created_at , that's a

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.