I have a calculated value that I need to display with two decimal places in a word document. I tried using the round command on the local variable and that makes no difference. It shows the variable as having 2 decimal places but these disappear when inserted into word. Set Decimals To 2 makes no difference either.
Word has the format command in VBA (see example below from word VBA help)
However, I am not sure how, if at all, I can run this function from VFP. The only way I can think of getting around this would be trying to detect if the result is an integer; turning the value into a string and tacking on ".00".
Any ideas on this would be appreciated. I am running VFP9.
Many thanks
Mark Davies
Warwickshire County Council
Code:
oWord.SELECTION.TEXT = ROUND(lninvtotal,2)
Word has the format command in VBA (see example below from word VBA help)
Code:
MyStr = Format(5459.4, "##,##0.00") ' Returns "5,459.40".
However, I am not sure how, if at all, I can run this function from VFP. The only way I can think of getting around this would be trying to detect if the result is an integer; turning the value into a string and tacking on ".00".
Any ideas on this would be appreciated. I am running VFP9.
Many thanks
Mark Davies
Warwickshire County Council