sonu gupta | 1bb37b8 | 2016-11-11 16:51:18 +0530 | [diff] [blame] | 1 | module decimal64 { |
| 2 | |
| 3 | yang-version 1; |
| 4 | |
| 5 | namespace "ydt.decimal64"; |
| 6 | |
| 7 | prefix "decimal64"; |
| 8 | |
| 9 | organization "ON-LAB"; |
| 10 | |
| 11 | description "This module defines for decimal64 classifier."; |
| 12 | |
| 13 | revision "2016-05-24" { |
| 14 | description "Initial revision."; |
| 15 | } |
| 16 | leaf negInt { |
| 17 | type decimal64 { |
| 18 | fraction-digits 2; |
| 19 | } |
| 20 | } |
| 21 | |
sonu gupta | eff184b | 2016-11-24 12:43:49 +0530 | [diff] [blame] | 22 | leaf posInt { |
sonu gupta | 1bb37b8 | 2016-11-11 16:51:18 +0530 | [diff] [blame] | 23 | type decimal64 { |
sonu gupta | eff184b | 2016-11-24 12:43:49 +0530 | [diff] [blame] | 24 | fraction-digits 2; |
sonu gupta | 1bb37b8 | 2016-11-11 16:51:18 +0530 | [diff] [blame] | 25 | } |
| 26 | } |
| 27 | |
| 28 | leaf negIntWithMinFraction { |
| 29 | type decimal64 { |
| 30 | fraction-digits 1; |
| 31 | } |
| 32 | } |
| 33 | |
sonu gupta | eff184b | 2016-11-24 12:43:49 +0530 | [diff] [blame] | 34 | leaf posIntWithMinFraction { |
sonu gupta | 1bb37b8 | 2016-11-11 16:51:18 +0530 | [diff] [blame] | 35 | type decimal64 { |
sonu gupta | eff184b | 2016-11-24 12:43:49 +0530 | [diff] [blame] | 36 | fraction-digits 1; |
| 37 | } |
| 38 | |
| 39 | } |
| 40 | leaf negIntWithMaxFraction { |
| 41 | type decimal64 { |
| 42 | fraction-digits 18; |
sonu gupta | 1bb37b8 | 2016-11-11 16:51:18 +0530 | [diff] [blame] | 43 | } |
| 44 | } |
| 45 | |
| 46 | leaf posIntWithMaxFraction { |
| 47 | type decimal64 { |
| 48 | fraction-digits 18; |
| 49 | } |
| 50 | |
| 51 | } |
| 52 | |
sonu gupta | eff184b | 2016-11-24 12:43:49 +0530 | [diff] [blame] | 53 | leaf midIntWithRange { |
sonu gupta | 1bb37b8 | 2016-11-11 16:51:18 +0530 | [diff] [blame] | 54 | type decimal64 { |
sonu gupta | eff184b | 2016-11-24 12:43:49 +0530 | [diff] [blame] | 55 | fraction-digits 2; |
| 56 | range "10 .. 100"; |
| 57 | } |
sonu gupta | 1bb37b8 | 2016-11-11 16:51:18 +0530 | [diff] [blame] | 58 | } |
| 59 | |
| 60 | leaf minIntWithRange { |
| 61 | type decimal64 { |
| 62 | fraction-digits 2; |
| 63 | range "10 .. 100"; |
| 64 | } |
| 65 | } |
| 66 | |
sonu gupta | 1bb37b8 | 2016-11-11 16:51:18 +0530 | [diff] [blame] | 67 | leaf maxIntWithRange { |
| 68 | type decimal64 { |
| 69 | fraction-digits 2; |
| 70 | range "10 .. 100"; |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | list multiRangeValidation { |
| 75 | config false; |
| 76 | leaf decimal { |
| 77 | type decimal64 { |
| 78 | fraction-digits 2; |
| 79 | range "10..40 | 50..100"; |
| 80 | } |
| 81 | } |
| 82 | leaf revDecimal { |
| 83 | type decimal64 { |
| 84 | fraction-digits 2; |
| 85 | range "min .. 3.14 | 10 | 20..max"; |
| 86 | } |
| 87 | } |
| 88 | } |
sonu gupta | eff184b | 2016-11-24 12:43:49 +0530 | [diff] [blame] | 89 | |
| 90 | leaf l1 { |
| 91 | type decimal64 { |
| 92 | fraction-digits 2; |
| 93 | } |
| 94 | } |
sonu gupta | 1bb37b8 | 2016-11-11 16:51:18 +0530 | [diff] [blame] | 95 | } |