Various changes have been made as a result of the discussion of the first version
This commit is contained in:
@@ -2,7 +2,8 @@ pragma Singleton
|
||||
import QtQuick 2.12
|
||||
|
||||
QtObject {
|
||||
function roundDouble(value) {
|
||||
return Math.round((value + Number.EPSILON) * 100) / 100
|
||||
function roundDouble(value, decimals = 2) {
|
||||
var factor = Math.pow(10, decimals)
|
||||
return Math.round((value + Number.EPSILON) * factor) / factor
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user