Format as a decimal number with the given precision and scale.
(self, precision, scale)
| 914 | return v |
| 915 | |
| 916 | def format(self, precision, scale): |
| 917 | """ |
| 918 | Format as a decimal number with the given precision and scale. |
| 919 | """ |
| 920 | v = int(self) |
| 921 | with decimal.localcontext() as ctx: |
| 922 | ctx.prec = precision |
| 923 | ctx.capitals = False |
| 924 | return str(decimal.Decimal(v).scaleb(-scale)) |
| 925 | |
| 926 | |
| 927 | class Decimal128(BaseDecimal): |