CDbl truncates large numbers

2 posts, 0 answers
  1. David
    David avatar
    0 posts
    Member since:
    Sep 2012

    Posted 06 Mar 2014 Link to this post

    I am attempting to use a formula to convert a string to a numeric field.  I need to support very large numbers.  When I use the CDbl function, it seems to only return 15 significant digits.

    CDbl('345,234,231,234.45678') = 345,234,231,234.457

    CDbl('791,345,234,231,234.45678') = 791,345,234,231,235

    CDbl('791,345,234,231,487,234.45678') = 791,345,234,231,487,000

    CDbl('0.45678834579852369425') = 0.456788345798524000000

    Is there another function that I should be using that would convert these strings properly?
  2. Peter
    Admin
    Peter avatar
    1611 posts

    Posted 07 Mar 2014 Link to this post

    Hi David,

    The CDbl function converts the expression to double and this is limitation of the data type. For more info see: double (C# Reference). Still you can utilize user functions to convert the values and make the required calculation.

    Best Regards,
    Petar
  3. DevCraft banner
Back to Top