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

192
Views
Smarty agrega dos 0 después de ",'

tengo mi variable

 {assign var='reduc' value=$valueprice} {assign var='prix' value='30,00'}

yo lo hice

 {$prix - ($prix * $reduc)}

¡Pero quiero que el resultado se muestre con dos números después de "," al final siempre! like si el resultado es:

 30 => 30,00 24,5 => 24,50

Ya probé con |string_format:"%.2f" no funciona

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

El uso de variables flotantes para valores de dinero no es bueno, consulte, por ejemplo, http://floating-point-gui.de/basic/

Entonces, si está utilizando valores enteros, podría hacer algo como:

 {$dollar},{$cent|string_format:"%02d"}
over 4 years ago · Santiago Trujillo 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!