# Calculated Field Produces extra space in result

Question asked by lindseym on Jan 27, 2017
Latest reply on Jan 27, 2017 by lindseym

To star, I found this post but it did not lead me to a solution that was noticeable to me

Nagging Problem in Calculated Field Produces extra space in result

I'm running FMP 14.0.6.

What I am getting as a result is:

101 F

What I expect:

101F

There are some results that have the letter in front of the numbers and those results are as expected.

Here is my calculation:

Let ( [

t = LeftWords ( Location Calculation ; 1 ) ;

x = Filter ( LeftWords ( t ; 1 ) ; "0123456789" )  = LeftWords ( t ; 1 ) ;

l = Length ( LeftWords ( t ; 1 ) ) ;

n = GetAsNumber ( LeftWords ( t ; 1 ) ) ;

Case (

x ;

n & Right ( t ; Length ( t ) - l ) ;

t

)

] ;

// And the second: (substitutes)

Substitute (

\${Copy Side A} ;

[ "XLEVEL#" ; "*" & Level from Space ] ;

[ "LEVEL#" ; Level from Space ] ;

[ "STAIR#" ; Stair from Space ] ;

[ "BLDG#" ; If ( PatternCount ( GetAsText ( Building from Space) ; "RL") > 0 ; "L" ; Building from Space )] ;

[ "LOC#" ; locationCalculationWithoutLeadingZeroes ] ;

// This is the substitution that would need the leading zeros removed

[ ";" ; "¶" ] ;

[ "TBD" ; TextStyleAdd ( "TBD" ; HighlightYellow ) ]

)

)

---------------

And my incoming data is "BLDG#LOC#" So I know there is no space between the two. It doesn't seem to be a space associated before the letter or after the number as I align the fields flush right and left in layout and there doesn't seem to be hidden characters (I don't know how to "show hidden characters" like you would in Adobe Illustrator.

Does anyone see what I am missing?

Thank you Kindly,

-L

I've also added some photos for support.