Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-1437

Normalize Decimal64 scale in DecimalStringCodec

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Medium
    • Resolution: Done
    • None
    • 9.0.0, 8.0.6
    • data-impl
    • None

    Description

      DecimalStringCodec contains the following:

          @Override
          protected Decimal64 deserializeImpl(final String product) {
              // FIXME: run value validation
              return Decimal64.valueOf(product);
          }
      

      This conversion disregards fraction-digits, leading to internal representation not matching the underlying schema. After parsing the string we need to consult the DecimalTypeDefinition and use Decimal64.scaleTo() to normalize the value to match fraction-digits.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              rovarga Robert Varga
              rovarga Robert Varga
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: