Free Support Forum - aspose.com

Formfield.settextinputvalue with formatstring

when i set the text input value on a formated formfield formfield.textinputformat="#.##0,00 €" the format is not right after the input.

formfield.textinputformat="#.##0,00 €

formfield.textinputvalue=1234567.3465763

formfield.result is 1234567,34565 €


This message was posted using Aspose.Live 2 Forum

Hi

Thanks for your inquiry. Please try using the following code.

Document doc = new Document(@"Test049\in.doc");

doc.Range.FormFields["myFormField"].TextInputType = TextFormFieldType.NumberText;

doc.Range.FormFields["myFormField"].TextInputFormat = "#,##0.00 €";

doc.Range.FormFields["myFormField"].SetTextInputValue(1234567.3465763);

doc.Save(@"Test049\out.doc");

At the moment Aspose.Words requires picture format switches to be in the US (InvariantCulture) format.

This is because Aspose.Words uses standard .NET functions to format values. The standard .NET functions require InvariantCulture format strings. The output will be different of course depending on the current culture on the machine, but the input format string must be in the InvariantCulture.

Please see also the following thread

http://www.aspose.com/community/forums/thread/93067.aspx

Best regards.