Skip to content

Docs for arithmetic expressions#2667

Open
olavsorl wants to merge 6 commits intomasterfrom
feature/arithmetic-expressions
Open

Docs for arithmetic expressions#2667
olavsorl wants to merge 6 commits intomasterfrom
feature/arithmetic-expressions

Conversation

@olavsorl
Copy link

@olavsorl olavsorl commented Feb 4, 2026

Docs for the new expressions +-*/

Summary by CodeRabbit

  • Documentation
    • Added reference entries for four arithmetic functions — plus, minus, multiply, divide — each with descriptions, parameter/return details, and concrete JSON usage examples showing inputs and numeric results and null-behavior notes.
    • Updated function tables and adjusted formatting and table alignment in the expressions reference so the new functions appear consistently with availability notes for front-end/back-end.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 4, 2026

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'auto_resolve_threads'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
📝 Walkthrough

Walkthrough

Adds documentation entries for four arithmetic expression functions — plus, minus, multiply, and divide — with definitions, parameters, JSON usage examples, numeric outputs, availability markers, and minor formatting adjustments in English and Norwegian Bokmål reference pages; Nynorsk not updated.

Changes

Cohort / File(s) Summary
Expressions reference — English
content/altinn-studio/v8/reference/logic/expressions/_index.en.md
Added public docs for plus, minus, multiply, and divide: parameter/return signatures, example JSON inputs and numeric outputs, updated function tables and availability markers, and minor formatting. (+63/-15 lines)
Expressions reference — Norwegian Bokmål
content/altinn-studio/v8/reference/logic/expressions/_index.nb.md
Added localized expandable docs for plus, minus, multiply, and divide with examples and table/header formatting adjustments; documentation-only changes. (+63/-15 lines)
Expressions reference — Norwegian Nynorsk (not present)
content/altinn-studio/v8/reference/logic/expressions/_index.nn.md
No changes in this PR — Nynorsk page not modified or added.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

➕ ➖ ✖️ ➗
Four small functions take the stage,
Examples printed on the page,
English, Bokmål—side by side,
Docs now hum with simple pride.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Docs for arithmetic expressions' directly and accurately summarizes the main change—adding documentation for four new arithmetic functions (+, -, *, /).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/arithmetic-expressions

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Fix all issues with AI agents
In `@content/altinn-studio/v8/reference/logic/expressions/_index.en.md`:
- Around line 313-317: The table of function parameters is inconsistent with the
detailed docs; update the parameter column entries for the functions `plus`,
`minus`, `multiply`, `divide`, and `average` so they match their detailed
descriptions: change `plus` and `minus` from "none or multiple numbers" to "one
or multiple numbers" (or "at least one number"), and change `multiply`,
`divide`, and `average` from "one or multiple numbers" to "two or multiple
numbers" (or "at least two numbers"); ensure the table text for these symbols
(`plus`, `minus`, `multiply`, `divide`, `average`) exactly mirrors the phrasing
used in their respective detailed sections.

In `@content/altinn-studio/v8/reference/logic/expressions/_index.nb.md`:
- Around line 308-312: The table rows for functions `plus`, `minus`, `multiply`,
`divide`, and `average` use invalid fragment link syntax `[Tall]($tall)`; update
each occurrence to use the correct markdown fragment link `[Tall](`#tall`)` so the
links point to the Tall section, e.g. inside the table cells for `plus`,
`minus`, `multiply`, `divide`, and `average` replace `$tall` with `#tall`.
- Around line 310-312: The parameter descriptions in the table for the functions
`multiply`, `divide`, and `average` are inconsistent with their detailed docs
(which state they expect at least two numbers); update the table entries for
`multiply`, `divide`, and `average` so the parameter column reads that they
require "minst to [Tall]" (or equivalent Norwegian phrasing matching the
detailed descriptions) instead of "et eller flere [Tall]" to keep them aligned
with the detailed descriptions.
- Around line 308-309: The Norwegian docs for the functions plus and minus are
inconsistent with the English version: update the Norwegian descriptions and the
table entries for the functions plus and minus to match the English requirement
of allowing at least one number (i.e., accept one or more arguments), not "minst
to tall"; specifically change any Norwegian phrases like "minst to tall" or "et
eller flere valgfrie [Tall]" to clearly state "minst ett tall" or "ett eller
flere tall" and ensure the parameter column for `plus` and `minus` reflects
one-or-more [Tall] arguments to match the English docs for the functions plus
and minus.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@content/altinn-studio/v8/reference/logic/expressions/_index.en.md`:
- Around line 298-316: Table parameter label casing is inconsistent: change the
"[numbers](`#numbers`)" labels to "[Number](`#numbers`)" for the `plus`, `minus`,
`multiply`, and `divide` rows so they match the rest of the table; update the
three occurrences in the rows for functions named plus, minus, multiply, and
divide to use the capitalized label.

@olavsorl olavsorl moved this to 🔎 In review in Team Altinn Studio Feb 10, 2026
Copy link
Contributor

@TomasEng TomasEng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dette ser bra ut, men vi bør kanskje også dokumentere hvordan uttrykkene responderer på null?

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
content/altinn-studio/v8/reference/logic/expressions/_index.en.md (1)

1085-1127: Minor wording inconsistency across function descriptions.

The plus and minus functions use singular form "decimal or integer" (lines 1086, 1097), whilst multiply and divide use plural "decimals or integers" (lines 1108, 1119). Consider standardising to the plural form throughout for consistency, as it's slightly more natural when referring to general classes of numbers.

📝 Optional consistency fix
 {{% expandlarge id="func-plus" header="plus" %}}
-The `plus` function expects two numbers, either decimal or integer.
+The `plus` function expects two numbers, either decimals or integers.

 Example:
 {{% expandlarge id="func-minus" header="minus" %}}
-The `minus` function expects two numbers, either decimal or integer.
+The `minus` function expects two numbers, either decimals or integers.

 Example:
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@content/altinn-studio/v8/reference/logic/expressions/_index.en.md` around
lines 1085 - 1127, Standardize wording by changing the `plus` and `minus`
descriptions to use the plural form "decimals or integers" to match `multiply`
and `divide`; update the text inside the `plus` and `minus` expandblocks
(identifiers func-plus and func-minus) so each reads "expects two numbers,
either decimals or integers" and keep the rest of the examples and null behavior
unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@content/altinn-studio/v8/reference/logic/expressions/_index.en.md`:
- Around line 1085-1127: Standardize wording by changing the `plus` and `minus`
descriptions to use the plural form "decimals or integers" to match `multiply`
and `divide`; update the text inside the `plus` and `minus` expandblocks
(identifiers func-plus and func-minus) so each reads "expects two numbers,
either decimals or integers" and keep the rest of the examples and null behavior
unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c19d2f0f-becb-4427-b799-a6b61ef4bcb5

📥 Commits

Reviewing files that changed from the base of the PR and between a3451a1 and 06df524.

📒 Files selected for processing (2)
  • content/altinn-studio/v8/reference/logic/expressions/_index.en.md
  • content/altinn-studio/v8/reference/logic/expressions/_index.nb.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🔎 In review

Development

Successfully merging this pull request may close these issues.

2 participants