10
Answers

saving decimal number

Ask a question
albert albert

albert albert

12y
5.6k
1
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)