refactor: organize backend by business responsibility
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { Decimal } from '../../common/decimal';
|
||||
|
||||
const NANO = 1_000_000_000n;
|
||||
|
||||
export type ProtoDecimal = { units?: string | number; nano?: string | number };
|
||||
|
||||
export function decimal(value: ProtoDecimal): Decimal {
|
||||
return {
|
||||
value: BigInt(value.units ?? 0) * NANO + BigInt(value.nano ?? 0),
|
||||
scale: 9,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user