Tailor field type number - float is getting interger

I have this tailor fields:

    map_lat: 
        label: Karten Marker Breitengrad
        type: number
    map_long: 
        label: Karten Marker Längengrad
        type: number

As soon as I reload my saved floats, they get rounded up. What am I doing wrong?

Well, I now just went into the DB and changed the fields map_lat and map_long from INT to DECIMAL.

But it would be nice, if there’d be possibility to define that per field, like:

map_lat: 
        label: Karten Marker Breitengrad
        type: float

EDIT: sorry, just saw it’s about Tailor.

Take a look at your migration files in

plugins\your_author_name\your_plugin\updates\some_file_to_create_or_update_your_table.php, you probably had:

$table->integer('your_field')

instead of :

$table->decimal('your_field', 10, 2)

Take a look to the Available Column Types when migrating.

Database: Migrations - Laravel 9.x - The PHP Framework For Web Artisans

1 Like