Bug Report T936265
Visible to All Users

Usability - The SetValueFromText method does not parse a string with a number in the currency format

created 4 years ago

Hi,

we make use of the SetValueFormText method.

Most of the behavior is equivalent to the parsing behavior in Microsoft Excel. It seems that SetValueFromText does not parse currency. Time strings are parsed differently too.
With the following code snippet you can test this cases:

C#
var wb = new Workbook(); wb.CreateNewDocument(); var worksheet = wb.Worksheets[0]; worksheet.Cells[0].SetValueFromText("19.09.2020"); worksheet.Cells[1].SetValueFromText("19.09.2020 08:22"); worksheet.Cells[2].SetValueFromText("19.09.20"); worksheet.Cells[3].SetValueFromText("08:22"); // Excel: 2020-10-01 08:22:00 / DevExpress Spreadsheet: 1899-12-31 08:22:00 worksheet.Cells[8].SetValueFromText("1000 €"); worksheet.Cells[9].SetValueFromText("1000 $"); wb.SaveDocument(@"C:\Temp\Test.xlsx", DocumentFormat.Xlsx);

What do you recommend to parse currency or is this a bug in SetValueFromText?

Regards
Dominik

Comments (3)
DevExpress Support Team 4 years ago

    Hi Dominik,

    I didn't notice any issue with a time string. Please illustrate the problem with a screenshot or video.

    As for the currency strings, I need additional time to check if it is possible to parse them using our components. I will update this thread once I have any results.

      Sorry this was a failure on my side. With time string everything is fine.

      DevExpress Support Team 4 years ago

        Thank you for your clarification. There is no straightforward approach to parse the "1000 €" string using the SetValueFromText method.

        I will pass this thread to our developers. They will research if it is possible to extend the SetValueFromText method with this functionality. We will update this ticket once we have any results.

        Unless I'm mistaken, the current culture on your machine is set to German. So, the above strings should be parsed according to the German number format settings. Please clarify this point.

        Answers approved by DevExpress Support

        created 4 years ago

        We have addressed the issue described in this ticket and will include a fix in our next maintenance update. To apply this solution before official release, request a hotfix by clicking the appropriate version link.

        Note: Hotfixes may be unavailable for betas/updates set for release within a week.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.