5 Replies Latest reply on Jan 22, 2013 10:54 PM by xyrejeddiah

# multiply field value if  it has four decimal places

### Title

multiply field value if  it has four decimal places

### Post

Hi,

I'm trying to create a calculated number field named "RESULT" the reference number field is "AREA" which contains values measured in hectares and sq.m. without symbols. Now i want to happen is if "AREA" value has four decimal places multiply it with 1,000 but if not just return the AREA value.

Thanks...

• ###### 1. Re: multiply field value if  it has four decimal places

area * Max ( 1 ; 1000 * ( Length ( Mod ( area ; 1 ) ) = 5 ) )

• ###### 2. Re: multiply field value if  it has four decimal places

Note that this works if you want this when the number of decimal places is exactly 5. you may need a > operator.

• ###### 3. Re: multiply field value if  it has four decimal places

Thanks for all your answers, but unfortunately it doesn't work fine for me, because when i enter 1.0000 or 2.0000 it gives me a result of 1 & 2 respectively in which my desired result would be 1,000 & 2,000.

• ###### 4. Re: multiply field value if  it has four decimal places

1.0000 and 2.0000 aren't numbers and they have not 4 decimal.

BTW: try:

Let(
dec = GetValue ( Substitute ( GetAsText ( area ) ; "." ; ¶ ) ; 2 ) ;
area * Max ( 1 ; 1000 * ( Length ( dec ) = 4 ) )
)
• ###### 5. Re: multiply field value if  it has four decimal places

Thanks!!! raybaudi it works!!!