Format as a decimal number with the given precision and scale.
(self, precision, scale)
| 919 | return v |
| 920 | |
| 921 | def format(self, precision, scale): |
| 922 | """ |
| 923 | Format as a decimal number with the given precision and scale. |
| 924 | """ |
| 925 | v = int(self) |
| 926 | with decimal.localcontext() as ctx: |
| 927 | ctx.prec = precision |
| 928 | ctx.capitals = False |
| 929 | return str(decimal.Decimal(v).scaleb(-scale)) |
| 930 | |
| 931 | |
| 932 | class Decimal32(BaseDecimal): |