View Full Version : [CLOSED] DecimalSeparator in NumberField

Jul 22, 2013, 9:29 AM

I'm developing a multi-language site. When I work with NumberField in French, the decimal separator is ",". And I must type "," in the keyboard for the decimal number. But in the keyboard, there is a number pad on the right with "." character. In many other application like microsoft excel, it converts automatically "." to "," when I press this button.
So, my question is: How can I use "," and "." (on the number pad) buttons for decimal separator. And on the screen, it shows only ","?

Thank you,

@model dynamic

@{ Layout = null;}


@(Html.X().FormPanel().Title("Test NumberField")
.Items(i =>
i.Add(Html.X().NumberField().FieldLabel("Test NumberField"));

Jul 22, 2013, 2:27 PM
Hi @UnifyEducation,

I would try to override a NumberField's filterKeys function.


<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>
<head runat="server">
<title>Ext.NET v2 Example</title>

var myfilterKeys = Ext.Function.createSequence(Ext.form.field.Number. prototype.filterKeys, function (e) {
var charCode = String.fromCharCode(e.getCharCode());

if (charCode === "." && this.decimalSeparator === ",") {
this.setRawValue(this.getRawValue() + ",");
<form runat="server">
<ext:ResourceManager runat="server" Locale="fr" />

<ext:NumberField runat="server">
<ext:ConfigItem Name="filterKeys" Value="myfilterKeys" Mode="Raw" />