DataSet parser trims leading and trailing 0s by default when the number is assigned to a field. For instance, here is the parser output of parsing 00013 and 13.131313000
00013 and 13.131313000
leadzero: 13
message: 00013 and 13.131313000
trailingzero: 13.131313
This results in the parsing field losing its raw message's value and affects the data accuracy
As a result, we added a new parsing attribute to the parser engine to address the problem. By parsing the value as raw string, it prevents conversion to a number and changing its format. To use it, the attribute needs to be specified as $attributeName{parse=string}$
Using the same example from above, the parser definition would be like:
{
formats: [
{
format: "$leadzero{parse=string}$ and $trailingzero{parse=string}$"
}
]
}
It will produce the parsing output in its original format:
00013 and 13.131313000
leadzero: 00013
message: 00013 and 13.131313000
trailingzero: 13.131313000
Comments
0 comments
Please sign in to leave a comment.