Imported from previous forum
Should a FIX Engine handle the possibility that incoming messages have (1) Field Tags, or (2) sequence numbers padded with leading zeroes?
My reading of the FIX spec suggests not, but I can’t find a categorical statement.
I know implementations exist in which numeric values have leading zeros. 00023 is a valid number which evaluates to 23. I’ve never seen this done on tags. I would recommend parsing to <tag> = <value> as 2 strings and then do string to numeric conversion on the tag and, if applicable the value. Most languages’ version of atoi() should handle that. I’m not aware of any statement in the spec which explicitly disallows leading zeros on numerics.
> Should a FIX Engine handle the possibility that incoming messages have (1) Field Tags, or (2) sequence numbers padded with leading zeroes?
>
> My reading of the FIX spec suggests not, but I can’t find a categorical statement.
>
[ original email was from John Hardman - yiq12@dial.pipex.com ]
The FIX 4.2 specification refers in various places to “tag numbers” but doesn’t explicitly state that tags are of type int. Could a statement be added in the next errata to say that tags are of type int ? This would resolve the issue of leading zeroes raised some time ago. If the tag is an int leading zeroes would be ignored, whereas is the tag were treated as a string leading zeroes would be significant, i.e. as an int 50 = 0050, whereas as a string 50 <> 0050.
Regards,
John Hardman.
> I know implementations exist in which numeric values have leading zeros. 00023 is a valid number which evaluates to 23. I’ve never seen this done on tags. I would recommend parsing to <tag> = <value> as 2 strings and then do string to numeric conversion on the tag and, if applicable the value. Most languages’ version of atoi() should handle that. I’m not aware of any statement in the spec which explicitly disallows leading zeros on numerics.
>
> > Should a FIX Engine handle the possibility that incoming messages have (1) Field Tags, or (2) sequence numbers padded with leading zeroes?
> >
> > My reading of the FIX spec suggests not, but I can’t find a categorical statement.
> >
>