albert albert

albert albert

  • NA
  • 524
  • 0

committing to databaase without ',' but with '.'

Jun 10 2012 6:10 AM
Hi everybody,

I have this:

view - editing:
[code]
 <td>
  <div class="editor-label">
  @Html.Label("Maandag")
  </div>
  <div class="editor-field">
  @string.Format(new System.Globalization.CultureInfo("en-US"), "{0:0.##}", Model.Monday)
  @Html.TextBox("Monday", Model.Monday.ToString(), new{@readonly = "readonly" })
  @Html.ValidationMessageFor(model=> model.Monday)
  </div>
  </td>
[/code]

so I fill in the numbers as: 7.5, 8.5 but then in the Edit page the numbers will appear as comma's, like this: 7,5, 8,5.


And this is the Index page:

[code]
 <td>
 
  @Html.DisplayFor(modelItem => item.Monday) -
  @Html.DisplayFor(modelItem => item.MondayHours)
 
  </td>
 
[/code]

And this is the Edit page:

[code]
 <td>
  <div class="editor-label">
  @Html.Label("Maandag")
  </div>
  <div class="editor-field">
  @string.Format(new System.Globalization.CultureInfo("en-US"), "{0:0.##}", Model.Monday)
  @Html.Editor("Monday",Model.Monday)
  @Html.ValidationMessageFor(model=> model.Monday)
  </div>
 
  </td>
[/code]

Because if I go after the create page to the edit page the numbers are with comma's. So I have to fill in again the numbers, but then with dots.

THX for helping!!