On 11/13/18, 9:07 AM, "netmod on behalf of Juergen Schoenwaelder" 
<netmod-boun...@ietf.org on behalf of j.schoenwael...@jacobs-university.de> 
wrote:

    On Tue, Nov 13, 2018 at 01:33:01PM +0000, Balázs Lengyel wrote:
    > Hello,
    > 
    > In some cases I want a percentage without fractions. This could be defined
    > using range, by specifying the numbers 0 | 1 | 2 ... 99 | 100 in the 
range's
    > argument.
    > 
    >     typedef percent-short {
    >       type percent { range 0 | 1 | 2 ... 99 | 100; }  // didn't type out 
all the 101 integer values :-)
    >     }
    >
    
    I guess we need to settle on a small number of percentage types that
    people find useful and then module authors hopefully find what they
    need. I am not sure that listing 101 numbers is a good pattern to use
    (although it does achieve what you want). For percentages that have no
    fraction, you likely want to derive from a base type that is efficient
    to encode for binary encodings such as CBOR.

Or simply define a type with a base type of unit8 type and a range of 0-100. 

Acee 




    
    /js
    
    -- 
    Juergen Schoenwaelder           Jacobs University Bremen gGmbH
    Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
    Fax:   +49 421 200 3103         <https://www.jacobs-university.de/>
    
    _______________________________________________
    netmod mailing list
    netmod@ietf.org
    https://www.ietf.org/mailman/listinfo/netmod
    

_______________________________________________
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to