0

I'm working to show double data well in my routes.

From backend I insert the correct numbers but in the route it shows me my number but with other numbers.

As in my two attached images. enter image description here enter image description here

I'm looking for the october documentation but every attempt has failed.

My code in routes.php is:

Route::get('api/{lang}/to_add', function( $lang ) {
    $to_adds = To_adds::with( 'image' )->get();

    foreach ($to_adds as $k => $v) {
        $to_adds[$k] = $v->lang($lang);
    }

    return $to_adds;
});

Someone who can help me?

Alessandro
  • 101
  • 2
  • JScript does not have ex. Decimals like C#, so double is not exact for some numbers - there are probably 2 options - work with string or round. Or there are some libraries working with decimals in JS. One of google for JavaScript decimals search https://mikemcl.github.io/decimal.js/ probably PHP should have something similar too. – Jan Jul 25 '19 at 10:59
  • Hi I solved. After a few hours doing tests on the code, I found out that it was the google JsownViewer extension that gave this problem. – Alessandro Jul 26 '19 at 11:04

0 Answers0