Bug report #12856

format_number with negative argument causes error

Added by Jochen Huber about 9 years ago. Updated about 9 years ago.

Affected QGIS version:2.8.2 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:20949


When using "format_number" in an expression to format labels, entering a negative value for the number of decimals causes QGIS not to respond for some time until it displays the error "bad allocation".
Ideally, format_number would allow negative values to be able to round to whole tens, hundreds etc. like "round()" does. At least an error should be displayed immediately and with a meaningful message.


#1 Updated by Saber Razmjooei about 9 years ago

  • Resolution set to fixed/implemented
  • OS version deleted (Windows 7 Prof. x64)
  • Operating System deleted (Windows)
  • Status changed from Open to Feedback

It should work fine now in master. I think this is the patch 518072e9

#2 Updated by Saber Razmjooei about 9 years ago

  • Status changed from Feedback to Closed

Works for me. Feel free to reopen if still having problem.

Also available in: Atom PDF