Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have one field "MyYear__c" on my custmon object. This field has following details:

Data Type: Number
Length: 4
Decimal Places: 0

At the visualforce page it looks like this:

<apex:inputField value="{!obj.MyYear_c}" required="true"/>

The user must fill this field out and then the outputPanel is re-rendered. After that there is a dot in this field:

enter image description here

Is there a way to remove the dot? I don't want to use any "not clear" solutions like Javascript. I want to know is there a "native" visualforce or apex solution for that. I know there are some workrounds, but only for the outputText, not for inputField.

Thank you.

Here my code:


<apex:pageBlock id="mainBlock">
    <apex:pageBlockSection columns="2">
        <apex:inputField value="{!obj.MyNumber__c}" required="true"/>
        <apex:commandButton value="Validate" action="{!doValidation}" reRender="mainBlock"/>


public MyObject__c obj { get; set; }

public MyClass(){
    obj = new MyObject__c();

public PageReference doValidation(){
    // Validation stuff here
    return null;
share|improve this question
where comma is? I can only see dot. – doga Feb 26 '13 at 9:13
@doga thanks man, i just missed that ;) – Sergey Utko Feb 26 '13 at 9:15
Can you post your controller code? – Kevin O'Hara Feb 26 '13 at 15:07
Here's the idea to support number display formats. I think you'd need something like that if you want to use inputField and no JS. – Peter Knolle Feb 26 '13 at 16:50
Thanks to the constraints on the edit page, not in any way that would be desirable (ie a full override, but that defeats the page layout in general). Another option would be similar to your formula field solution, but instead of a formula field use a text field and then coordinate the validation and values between the two via workflows/triggers. So your "public" field would be text, and your value field would be the current one. – joshbirk Feb 26 '13 at 20:38
up vote 1 down vote accepted

Have you tried using inputText in your Visualforce?:

<apex:inputText value="{!obj.MyNumber__c}" required="true"/>

You will need to validate that the text is a number in your controller.

You will also need to make use of a formula field for standard UIs.

share|improve this answer
I will accept this answer as only solution for the "problem", apparently there are no other "native" solutions. Thanks Stephen. – Sergey Utko Feb 27 '13 at 7:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.