mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-03-17 17:04:10 +01:00
Compare commits
4 commits
b09d59bd37
...
6264b34caf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6264b34caf | ||
|
|
917f1dd8c1 | ||
|
|
909395ab3c | ||
|
|
b6198973e0 |
|
|
@ -1 +1 @@
|
|||
Clarify floaty powerlevels.
|
||||
Clarify meaning of floating-point powerlevels.
|
||||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue