private void renderNumberField(Number field) throws IOException {
            if (field instanceof Integer) {
                generator().writeNumber(field.intValue());
            } else if (field instanceof Float) {
                generator().writeNumber(field.floatValue());
            } else if (field instanceof Double) {
                generator().writeNumber(field.doubleValue());
            } else if (field instanceof Long) {
                generator().writeNumber(field.longValue());
            } else if (field instanceof Byte || field instanceof Short) {
                generator().writeNumber(field.intValue());
            } else if (field instanceof BigInteger bigint) {
                generator().writeNumber(bigint);
            } else if (field instanceof BigDecimal bigdec) {
                generator().writeNumber(bigdec);
            } else {
                generator().writeNumber(field.doubleValue());
            }
        }
Call after all fields in a hit to close the "fields" field of the JSON object
container-search/src/main/java/com/yahoo/search/rendering/JsonRenderer.java