@@ -167,7 +167,11 @@ export class BN {
167167 }
168168
169169 public get value ( ) : string {
170- return this . #bn. toString ( )
170+ return this . #bn. toFormat ( {
171+ groupSeparator : '' ,
172+ decimalSeparator : '.' ,
173+ fractionGroupSeparator : '' ,
174+ } )
171175 }
172176
173177 public clone ( cfg ?: BnCfg ) : BN {
@@ -238,19 +242,23 @@ export class BN {
238242 }
239243
240244 public isGreaterThan ( other : BN ) : boolean {
241- return this . #compare ( other ) === 1
245+ return this . #bn . isGreaterThan ( other . bn )
242246 }
243247
244248 public isGreaterThanOrEqualTo ( other : BN ) : boolean {
245- return this . #compare ( other ) >= 0
249+ return this . #bn . isGreaterThanOrEqualTo ( other . bn )
246250 }
247251
248252 public isLessThan ( other : BN ) : boolean {
249- return this . #compare ( other ) === - 1
253+ return this . #bn . isLessThan ( other . bn )
250254 }
251255
252256 public isLessThanOrEqualTo ( other : BN ) : boolean {
253- return this . #compare( other ) <= 0
257+ return this . #bn. isLessThanOrEqualTo ( other . bn )
258+ }
259+
260+ public isEqualTo ( other : BN ) : boolean {
261+ return this . #bn. isEqualTo ( other . bn )
254262 }
255263
256264 public round ( precision : number , mode ?: BN_ROUNDING ) : string {
@@ -302,17 +310,4 @@ export class BN {
302310 fractionGroupSeparator : '' ,
303311 } )
304312 }
305-
306- /**
307- * this > other => 1;
308- * this < other => -1;
309- * this === other => 0;
310- *
311- * @param {BnLike } other
312- * @returns {number }
313- */
314- #compare( other : BN ) : number {
315- const [ numA , numB ] = BN . #toGreatestDecimals( this , other )
316- return numA . bn . comparedTo ( numB . bn )
317- }
318313}
0 commit comments