Compare commits

...

4 commits

Author SHA1 Message Date
Kierre 6264b34caf
clarify exponential notation and add canonical JSON note 2026-01-28 12:05:35 -05:00
Kierre 917f1dd8c1
"visually" -> "technically"
this makes more sense to me
2026-01-28 11:37:58 -05:00
Kierre Sametti 909395ab3c
Update content/rooms/fragments/v1-floaty-power-levels.md
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2026-01-28 11:03:16 -05:00
Kierre Sametti b6198973e0
Update changelogs/room_versions/newsfragments/2297.clarification
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2026-01-28 11:02:53 -05:00
2 changed files with 9 additions and 3 deletions

View file

@ -1 +1 @@
Clarify floaty powerlevels.
Clarify meaning of floating-point powerlevels.

View file

@ -1,5 +1,5 @@
##### `m.room.power_levels` Events Accept Values as Floats
##### `m.room.power_levels` events accept values as floats
When the value is a float, anything after the decimal point is removed,
making e.g. `5.17`, `5.42`, and `5` functionally identical.
@ -31,4 +31,10 @@ For example, this is a valid `m.room.power_levels` event in this room version:
```
In this example, both `@bob:localhost` and `@alice:localhost` have the same effective
power level of `50`, even though the values are visually different.
power level of `50`, even though the values are technically different.
When a float written in exponential notation is unpacked, the decimal portion is removed
afterward; for example, `5.114698E4` becomes `51146.98`, which is then truncated to `51146`.
Note that, since this room version does not enforce that events comply with the requirements
of [Canonical JSON](/appendices#canonical-json), power levels can be formatted as floats.