@wg-npm/survey-core 0.5.739 → 0.5.740

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -154,7 +154,8 @@ class BaseQuestionModel {
154
154
  return (_.max(_.map(question.choices, (choice) => parseFloat(_.get(choice, "options.score", 0) || 0))) || 0);
155
155
  }
156
156
  else if (question.type == "MULTI_SELECTION") {
157
- return _.sumBy(question.choices, (item) => parseFloat(_.get(item, "options.score") || 0));
157
+ const result = _.sumBy(question.choices, (item) => parseFloat(_.get(item, "options.score") || 0));
158
+ return Math.round(result * 100) / 100;
158
159
  }
159
160
  else if (question.type == "MATRIX") {
160
161
  const score = _.max(_.map(question.choices, (choice) => parseFloat(_.get(choice, "options.score", 0) || 0))) || 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wg-npm/survey-core",
3
- "version": "0.5.739",
3
+ "version": "0.5.740",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -47,7 +47,7 @@
47
47
  "publishConfig": {
48
48
  "access": "public"
49
49
  },
50
- "gitHead": "1fd77d6d7787532ac46f555f9e57045cd0d9f7cf",
50
+ "gitHead": "8827d965dd9034cd2da953c829bd21ddbc3b8055",
51
51
  "rollup": {
52
52
  "external": [
53
53
  "lodash"
package/src/models.ts CHANGED
@@ -216,10 +216,11 @@ export class BaseQuestionModel {
216
216
  ) || 0
217
217
  );
218
218
  } else if (question.type == QuestionType.MULTI_SELECTION) {
219
- return _.sumBy(question.choices, (item: any) =>
220
- // @ts-ignore
221
- parseFloat(_.get(item, "options.score") || 0)
219
+ const result = _.sumBy(question.choices, (item: any) =>
220
+ // @ts-ignore
221
+ parseFloat(_.get(item, "options.score") || 0)
222
222
  );
223
+ return Math.round(result * 100) / 100;
223
224
  } else if (question.type == QuestionType.MATRIX) {
224
225
  const score =
225
226
  _.max(