Skip to content

Commit dc00cb0

Browse files
authored
feat: add decimal type (#1334)
1 parent 11be518 commit dc00cb0

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packages/clients/src/scw/custom-types.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,16 @@ export interface ScwFile {
6767
/** Content of the file in base64. */
6868
content: string
6969
}
70+
71+
/** A representation of a decimal value, such as 2.5.
72+
* Comparable to language-native decimal formats, such as Java's BigDecimal or Python's decimal.Decimal.
73+
* Lookup protobuf google.type.Decimal for details */
74+
export class Decimal {
75+
private readonly str: string
76+
77+
constructor(v: string) {
78+
this.str = v
79+
}
80+
81+
public toString = (): string => this.str
82+
}

0 commit comments

Comments
 (0)