Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

198
Views
Python Flask Parameter is rounded up in Javascript

Python code:

from flask import Flask, render_template
app = Flask(__name__)

@app.route("/")
def test():
    id = "2138291837273817238" # Can Be some random number
    return render_template("first.html", id=id)

if __name__ == "__main__":
    app.run("0.0.0.0", 8000)

Html:

<!DOCTYPE html>
<html>
<title>Testing</title>
<body style="background-color:#222736;">
<h1 style="color:#f6f6f6">Testing</h1>
</body>

<script>
console.log({{ id }})
</script>
</html>

Javascript console:

2138291837273817300

As you can see, 2138291837273817238 and 2138291837273817300 are not the same number. The parameter is always rounded up at the 17th number. Is this just a JavaScript error? Am I doing something wrong? And can someone reproduce this?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Solved: I had to put {{ id }} into "´s, so its "{{ id }}", then it isnt rounded up!

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!