# Verify numeric schema boundaries instead of assuming integer coercion

> Check Int, SmallInt, TinyInt and Number2 with native compact schemas, including fractional values, zero and out-of-range inputs.

Framework: total5
Product: Total.js 5 (total5@0.0.19)
Language: en
Content-SHA256: 164490677c2f9a2f3852886b573a46742243ade192a31b09fb8cad9656e73591
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: total5-installed@total5@0.0.19
Review: not-recorded

In `total5@0.0.19`, the compact numeric types all enter the native number validator. **`Int` does not guarantee an integer**: `7.9` is preserved. `Number2` also preserves this fraction; do not interpret its name as rounding to two decimal places. Required numeric zero is accepted.

`TinyInt` accepts values from 0 through 255. `SmallInt` accepts -32767 through 32767; notably, -32768 is rejected in this version. These subtype checks enforce bounds but do not require integral values: `TinyInt` accepts `1.5`. Apply an explicit `Number.isInteger()` check for identifiers, counters or quantities that must be integers. These observations describe this version and the tested values, not SQL column semantics.

```js controllers/numbers.js
var schema = NEWSCHEMA('NumericBoundaries', '*integer:Int,*small:SmallInt,*tiny:TinyInt,*decimal:Number2');

exports.install = function() {
	ROUTE('POST /numbers/ @json', numbers);
};

function numbers($) {
	var result = schema.transform($.body);
	if (result.error) {
		$.response.status = 400;
		$.json({ error: 'invalid numeric input' });
		return;
	}
	$.json(result.response);
}
```
