Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
185 views
in Q2A Core by

Hy, Is it possible to award points in decimal numbers to users.

 

For example: if user ask a question then he will get 0.001 points.

How to do this with point system of this script.

1 Answer

+1 vote
by

The database columns which store points are integers, so cannot contain decimal numbers. So I would recommend running Q2A will all points multiplied by a 1000, and then dividing by 1000 only at the presentation stage, i.e. when the points are converted to HTML for display.

You can search the source code for number_format and then wherever that is used to format points, make the change. For example in qa-page-users.php, change:

qa_html(number_format($user['points']))

... to ...

qa_html(number_format($user['points']/1000, 3))

Welcome to the Q&A site for Question2Answer.

If you have a question about Q2A, please ask here, in English.

To report a bug, please create a new issue on Github or ask a question here with the bug tag.

If you just want to try Q2A, please use the demo site.

Categories

...