albert albert

albert albert

  • NA
  • 524
  • 0

saving decimal number

Jun 8 2012 4:31 AM
Hi everyone,

I have this as Model:

[code]
[Required]
        public Decimal MondayHours { get; set; }
[/code]

and this in the view:

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

but I put for example an number: 7.5 that the number will be saved as:75,00. and not as: 7,5.

THX for helping!!

Answers (10)