* Creates a new [[FixedNumber]] with the big-endian representation * %%value%% with %%format%%. * * This will throw a [[NumericFaultError]] if %%value%% cannot fit * in %%format%% due to overflow.
(_value, _format)
| 513 | * in %%format%% due to overflow. |
| 514 | */ |
| 515 | static fromBytes(_value, _format) { |
| 516 | let value = (0, maths_js_1.toBigInt)((0, data_js_1.getBytes)(_value, "value")); |
| 517 | const format = getFormat(_format); |
| 518 | if (format.signed) { |
| 519 | value = (0, maths_js_1.fromTwos)(value, format.width); |
| 520 | } |
| 521 | checkValue(value, format, "fromBytes"); |
| 522 | return new FixedNumber(_guard, value, format); |
| 523 | } |
| 524 | } |
| 525 | exports.FixedNumber = FixedNumber; |
| 526 | //const f1 = FixedNumber.fromString("12.56", "fixed16x2"); |
nothing calls this directly
no test coverage detected