- Timestamp:
- 2018-01-26T22:34:54+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/data/validator/numeric.mapcss
r13349 r13357 55 55 } 56 56 57 *[height][height =~ /^[0-9]+,[0-9] +( (m|ft))?$/] {57 *[height][height =~ /^[0-9]+,[0-9][0-9]?( (m|ft))?$/] { 58 58 throwWarning: tr("unusual value of {0}: use . instead of , as decimal separator", "{0.key}"); 59 59 fixAdd: concat("height=", replace(tag("height"), ",", ".")); … … 62 62 assertMatch: "node height=12,00"; 63 63 assertMatch: "node height=12,5 ft"; 64 assertNoMatch: "node height=12,000"; 64 65 assertNoMatch: "node height=3,50,5"; 65 66 assertNoMatch: "node height=3.5"; … … 77 78 } 78 79 79 *[maxheight][maxheight =~ /^[0-9]+,[0-9] +( (m|ft))?$/] {80 *[maxheight][maxheight =~ /^[0-9]+,[0-9][0-9]?( (m|ft))?$/] { 80 81 throwWarning: tr("unusual value of {0}: use . instead of , as decimal separator", "{0.key}"); 81 82 fixAdd: concat("maxheight=", replace(tag("maxheight"), ",", ".")); … … 84 85 assertMatch: "node maxheight=12,00"; 85 86 assertMatch: "node maxheight=12,5 ft"; 87 assertNoMatch: "node maxheight=12,000"; 86 88 assertNoMatch: "node maxheight=3,50,5"; 87 89 assertNoMatch: "node maxheight=3.5"; … … 101 103 } 102 104 103 *[width][width =~ /^[0-9]+,[0-9] +( (m|ft))?$/] {105 *[width][width =~ /^[0-9]+,[0-9][0-9]?( (m|ft))?$/] { 104 106 throwWarning: tr("unusual value of {0}: use . instead of , as decimal separator", "{0.key}"); 105 107 fixAdd: concat("width=", replace(tag("width"), ",", ".")); … … 107 109 assertMatch: "node width=5,5"; 108 110 assertMatch: "node width=12,00"; 111 assertNoMatch: "node width=12,000"; 109 112 assertNoMatch: "node width=3,50,5"; 110 113 assertNoMatch: "node width=3.5"; … … 123 126 } 124 127 125 *[maxwidth][maxwidth =~ /^[0-9]+,[0-9] +( (m|ft))?$/] {128 *[maxwidth][maxwidth =~ /^[0-9]+,[0-9][0-9]?( (m|ft))?$/] { 126 129 throwWarning: tr("unusual value of {0}: use . instead of , as decimal separator", "{0.key}"); 127 130 fixAdd: concat("maxwidth=", replace(tag("maxwidth"), ",", ".")); … … 129 132 assertMatch: "node maxwidth=5,5"; 130 133 assertMatch: "node maxwidth=12,00"; 134 assertNoMatch: "node maxwidth=12,000"; 131 135 assertNoMatch: "node maxwidth=3,50,5"; 132 136 assertNoMatch: "node maxwidth=3.5"; … … 143 147 } 144 148 145 *[maxweight][maxweight =~ /^[0-9]+,[0-9] +( (t|kg|lbs))?$/] {149 *[maxweight][maxweight =~ /^[0-9]+,[0-9][0-9]?( (t|kg|lbs))?$/] { 146 150 throwWarning: tr("unusual value of {0}: use . instead of , as decimal separator", "{0.key}"); 147 151 fixAdd: concat("maxweight=", replace(tag("maxweight"), ",", ".")); … … 149 153 assertMatch: "node maxweight=5,5"; 150 154 assertMatch: "node maxweight=12,00"; 155 assertNoMatch: "node maxweight=12,000"; 151 156 assertNoMatch: "node maxweight=3,50,5"; 152 157 assertNoMatch: "node maxweight=3.5"; … … 181 186 } 182 187 183 *[distance][distance =~ /^[0-9]+,[0-9] +( (m|km|mi|nmi))?$/] {188 *[distance][distance =~ /^[0-9]+,[0-9][0-9]?( (m|km|mi|nmi))?$/] { 184 189 throwWarning: tr("unusual value of {0}: use . instead of , as decimal separator", "{0.key}"); 185 190 fixAdd: concat("distance=", replace(tag("distance"), ",", ".")); … … 187 192 assertMatch: "node distance=5,5"; 188 193 assertMatch: "node distance=12,00"; 194 assertNoMatch: "node distance=12,000"; 189 195 assertNoMatch: "node distance=3,50,5"; 190 196 assertNoMatch: "node distance=3.5"; … … 317 323 assertNoMatch: "node ele=high"; 318 324 } 319 *[ele][ele =~ /^[0-9]+,[0-9] +$/] {325 *[ele][ele =~ /^[0-9]+,[0-9][0-9]?$/] { 320 326 throwWarning: tr("unusual value of {0}: use . instead of , as decimal separator", "{0.key}"); 321 327 fixAdd: concat("ele=", replace(tag("ele"), ",", ".")); … … 323 329 assertMatch: "node ele=5,5"; 324 330 assertMatch: "node ele=12,00"; 331 assertNoMatch: "node ele=8,848"; /* wrongly used thousands separator */ 325 332 assertNoMatch: "node ele=3,50,5"; 326 333 assertNoMatch: "node ele=3.5";
Note:
See TracChangeset
for help on using the changeset viewer.