search

Home  >  Q&A  >  body text

laravel - ajax returns decimal display problem

The ajax request returned a decimal number. The preview tag in the browser debugging tool is like this:

The two decimal places shown above are the same as the database settings, but after consolelog(), there is no decimal point after:

There is no decimal point when displayed in html. How can I prevent it from omitting the decimal point?

PHP中文网PHP中文网2783 days ago686

reply all(2)I'll reply

  • 给我你的怀抱

    给我你的怀抱2017-05-16 16:51:33

    Either return a string or .toFixed(2) something

    reply
    0
  • 漂亮男人

    漂亮男人2017-05-16 16:51:33

    Then ajax returns 100 of the string

    reply
    0
  • Cancelreply