FacetWP – correct facet_value of a number-based taxonomy term

<?php

add_filter( 'facetwp_index_row', function( $params, $class ) {
    if ( 'weight' == $params['facet_name'] ) {
        $params['facet_value'] = str_replace( '-', '.', $params['facet_value'] );
    }
    return $params;
}, 10, 2 );