In some system decimal places are not considering

Sagar BS, Krishna 0 Reputation points
2023-04-25T11:25:31.1466667+00:00

We have some issue with displaying decimal places. one of our API sends Qty = 7.0 and 8.0 but it received as 70, 80 this happening in one particular system only. We are suspecting this might be the issue with some system configuration. Expert help needed. Thanks in advance.

Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Olaf Helper 47,441 Reputation points
    2023-04-25T11:40:14.54+00:00

    It's related to regional settings. Here in Germany the komma (,) is the decimal separator and the dot (.) the thausend separator; ignored when converting string to numeric. And so 7.0 becomes 70.

    2 people found this answer helpful.

  2. Limitless Technology 44,766 Reputation points
    2023-04-26T12:24:43.4233333+00:00

    Hi, I'd be happy to help you out with your question. Sorry for the inconvenience caused. I think the problem may be related to the system configuration or the way the API is being used. There are a few things you can check to try and resolve the issue. First, you should check the API documentation to make sure that the "Qty" field is supposed to contain decimal values. If it is, then the problem may be with the system that is receiving the API calls. You should also verify that the system is configured to handle decimal values correctly. It's possible that the system is rounding decimal values to the nearest integer or truncating them altogether, which could explain why you're seeing 70 and 80 instead of 7.0 and 8.0. Another possibility is that the code using the API is not interpreting the data correctly. Make sure that the code is expecting decimal values and that it is correctly interpreting the data that is received from the API. It's also a good idea to verify that the data is being sent and received in the correct format. If the API is sending the data as a string instead of a numeric value, for example, this could cause issues with decimal places. If none of these solutions work, you may want to contact the vendor or developer of the system for further assistance. They may be able to provide additional troubleshooting steps or help you resolve the issue. If you have any other questions or need assistance with anything, please don't hesitate to let me know. I'm here to help.

    If the reply was helpful, please don’t forget to upvote or accept as answer, thank you.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.