Closed solexsylvain closed 6 months ago
You need to set the Advice in your grammar to not have any separator for decimal mark. That makes it omitted when writing. Otherwise the format is only accounted for precision. It is the 7th argument on the set advice method.
grammar.SetAdvice('+', '+', ':', '\'', '?', null, null);
In the same EDI file, you could have 2 properties, one that needs output in N2 and the other in R. Won't it break for the R while making it work for the N2 if we set it with the grammar ?
You are correct. If this is an exception case then you are probably better off making the exception Value a sting instead of a decimal. Then handle the conversion when populating.
Alternatively make the Amount an int and pad it with multiplication:
Amount = (int)(myAmountDecimal * 100)
I was surprised to get an answer so fast. I had changed the property to string before creating the issue since I didn't know when I would get a reply. Thank you for the help.
With the following class
When the file is generated I end up with 0000000000015.25 instead of 000000000001525 for the Amount. The implicit doesn't remove the decimal separator. Am I missing something ?