numbas / Numbas

A completely browser-based e-assessment/e-learning system, with an emphasis on mathematics
http://www.numbas.org.uk
Apache License 2.0
197 stars 118 forks source link

updated trunc function #1009

Closed Anurag-Raut closed 1 year ago

Anurag-Raut commented 1 year ago

Fixes Issue #1008

Updated Trunc function so that it round x towards zero to p decimal places.

trunc(x= 2.4444, p = 2) // result->2.44 trunc(x= - 2.4444,p= 3) // result-> - 2.444 trunc(x=2.4444) //result->2

christianp commented 1 year ago

@Anurag-Raut please could you add your name to CONTRIBUTORS.md?

Anurag-Raut commented 1 year ago

Fixes Issue #1008

Updated Trunc function so that it round x towards zero to p decimal places.

trunc(x= 2.4444, p = 2) // result->2.44 trunc(x= - 2.4444,p= 3) // result-> - 2.444 trunc(x=2.4444) //result->2

done #1010