File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -444,6 +444,11 @@ if (typeof NumberDecimal !== 'undefined') {
444444        NumberDecimal . prototype  =  { } ; 
445445    } 
446446
447+     NumberDecimal . prototype . nativeToString  =  NumberDecimal . prototype . toString 
448+     NumberDecimal . prototype . toString  =  function ( )  { 
449+         return  `NumberDecimal("${ this . nativeToString ( ) }  ")` ; 
450+     } ; 
451+ 
447452    NumberDecimal . prototype . tojson  =  function ( )  { 
448453        return  this . toString ( ) ; 
449454    } ; 
Original file line number Diff line number Diff line change @@ -22,3 +22,6 @@ assert.strictEqual(minLong.bottom, 0);
2222assert . strictEqual ( minLong . exactValueString ,  "-9223372036854775808" ) ; 
2323const  nl2  =  NumberLong ( "200" ) ; 
2424assert . strictEqual ( maxLong . compare ( nl2 ) ,  1 ) ; 
25+ const  decimal  =  NumberDecimal ( "1.1" ) ; 
26+ assert . strictEqual ( decimal . toString ( ) ,  'NumberDecimal("1.1")' ) ; 
27+ assert . strictEqual ( decimal . tojson ( ) ,  'NumberDecimal("1.1")' ) ; 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments