10 Replies Latest reply on May 26, 2010 8:43 AM by comment_1

# how to remove the first "0" in certain field

### Title

how to remove the first "0" in certain field

### Post

Hi, everyone!

I am new to Filemaker,I find it is of great help to me

there is a field in my table and the value like this:

MIC

0.016

0.064

0.125

<=0.008

>256

8

0.5

I want to remove the first "0", if the value is less than 1, like this below:

MIC

.016

.064

.125

<=.008

>256

8

.5

can anyone can help me?

Thanks!

• ###### 1. Re: how to remove the first "0" in certain field

Substitute ( YourField ; "0." ; "." )

• ###### 2. Re: how to remove the first "0" in certain field

that works unless you have numerical values such as "80.123".

do you have any values greater than 10?

• ###### 3. Re: how to remove the first "0" in certain field

rdowler wrote:

that works unless you have numerical values such as "80.123".

That 's a good point. I am not sure if the field contains multiple values, or if the example shows mutliple records with one value per field. If the latter, I believe =

Case (
Abs (
YourField ) < 1 ; Substitute ( YourField ; "0." ; "." ) ;
Yourfield
)

should fix it.

• ###### 4. Re: how to remove the first "0" in certain field

comment wrote:

...or if the example shows mutliple records with one value per field.

Are you missing points ? ;)

In that case GetAsNumber ( YourField )  will be simpler.

• ###### 5. Re: how to remove the first "0" in certain field

Thank you very much

my values are like this:1 2 4 8 16 32 64 128 256 >256 0.5 0.25 0.125 0.064 and so on

• ###### 6. Re: how to remove the first "0" in certain field

comment wrote:

Substitute ( YourField ; "0." ; "." )

Yould simply use the above calculation but modify it just slighly:

If ( "YourField" > 9 ; "Your Field" ; Substitute ( YourField ; "0." ; "." ))

• ###### 7. Re: how to remove the first "0" in certain field

raybaudi wrote:
Are you missing points ? ;)

In that case GetAsNumber ( YourField )  will be simpler.

I am afraid I don't follow. If YourField contains "<=0.008", then

GetAsNumber ( YourField )

will return ".008" instead of the required "<=.008".

• ###### 8. Re: how to remove the first "0" in certain field

comment wrote:

I am afraid I don't follow. If YourField contains "<=0.008", then

GetAsNumber ( YourField )

will return ".008" instead of the required "<=.008".

Correct, I'm missing points !

BTW if there is only one field with multiple values, a solution may be:

Let(
text = Substitute ( ¶ & YourField & ¶
; [ "¶0." ; "¶."]
; [ "¶<0." ; "¶<."]
; [ "¶<=0." ; "¶<=."]
; [ "¶≤0." ; "¶≤."]
; [ "¶>0." ; "¶>."]
; [ "¶>=0." ; "¶>=."]
; [ "¶≥0." ; "¶≥."]
);
Substitute ( TrimAll ( Substitute ( text ; ¶ ; " " ) ; 1 ; 0 ) ; " " ; ¶ )
)

• ###### 9. Re: how to remove the first "0" in certain field

comment wrote:

Case (
Abs (
YourField ) < 1 ; Substitute ( YourField ; "0." ; "." ) ;
Yourfield
)

An alternate "chindogu" way:

Substitute ( Filter ( KanjiNumeral ( text ) ; text ) ;  Left ( 1/2 ; 1) ; ""  ) & GetAsNumber ( text )

• ###### 10. Re: how to remove the first "0" in certain field

LOL. But even a chindogu should handle negative values correctly...