Search code examples
jsfprimefacesentitybean-validation

Primefaces text in outputLabel pattern of réal


Is there any way to make a pattern to the value of outputLabel, I tried like this way :

@Digits(integer=3, fraction=2)

I put this annotation in my Entity but nothing is changed

Someone have an idea to chnage this number in ENTITY or in the page?

<p:outputLabel value="#{VarAvancementPrj.avancementprojet}%"/>

// @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
@Column(name = "avancementprojet", precision = 17, scale = 17)
@Digits(integer=3,fraction=2)
private Double avancementprojet;

enter image description here


Solution

  • You should add converter inside your outputlabel

    <f:convertNumber pattern="#0.00" />