Hi,
I am trying to display some concatinated double values as a string in my grid cell its working fine but only problem I have found is After 5 decimal places it convert the simple number in to exponential number like
12.0000034= 1234E-7. According to my findings while string formating it convert the value as exponential instead of simple double value. I know its solution is while converting double value to string put format for decimal places like .Tostring("F6"). for 6 number of decimal places. But I dont want to enter manually fixed number of decimal places. I want to have all decimal places data in my underlying datasource to display in grid. Can any one suggest some thing in this regard. Thanks
Hello,
I'm not completely sure about your logic for concatinating the double values but I guess that the issue might be related to the precision of the digits. In case you have a Field that contains a XamNumericEditor (default for the double values) you can assign custom ValueToDisplayText Converter to the editor where you return a double value based on the other two. Note that when concatinating the strings you will have to return no more then a 15 digits.
if you could provide a sample illustrating the problem that would help greatly in researching this issue.
Hi Zargoski,
Thanks for your reply. These are my findings about the issue:
If value is 0.0000567 or any value more then 5 digits leading by 0 (Before point )given earlier if you try to display such values in grid it autometically convert this double value as exponential value like, 0.0000567= 5.67E-5. But if you use decimal instead of double as type of variable then its working fine in this way 0.0000567m. The issue is notthing to do with concatination its just simple double value converssion problem to string. Can you please suggest some thing now?
I was not able to reproduce this issue. I tested this with a standard Field bound to a double value and using the same F6 format for the editor:
Without knowing how you implement your concatinating logic of the double values its hard to say exactly what is going on. Can you provide a little more information like - what is the type of the field you are using (field, unboundfield), is this field bound to any double property from the datasource, are you using any style for the editor in the field with custom format or valuetodisplaytextconverter.
<igDP:Field Name="Double">
<igDP:Field.Settings>
<igDP:FieldSettings>
<igDP:FieldSettings.EditorStyle>
<Style TargetType="{x:Type igEditors:XamNumericEditor}">
<Setter Property="Format" Value="F6"/>
<Setter Property="Mask" Value="{}{double:2.10}"/>
</Style>
</igDP:FieldSettings.EditorStyle>
</igDP:FieldSettings>
</igDP:Field.Settings>
</igDP:Field>
Could you provide a sample that demonstrates the issue?
I was wondering if you have managed to sort this issue out. Let us know if you need further assistance.