@@ -32,5 +32,37 @@ describe('steem.format.reputation', ()=> {
32
32
} ) ;
33
33
it ( 'rep -22233344455 => 12' , ( ) => {
34
34
assert . equal ( reputation ( - 22233344455 ) , 12 ) ;
35
- } ) ;
35
+ } ) ;
36
+
37
+ // with decimal places
38
+ it ( 'rep 0 => 25' , ( ) => {
39
+ assert . equal ( reputation ( 0 , 1 ) , 25 ) ;
40
+ } ) ;
41
+ it ( 'rep 95832978796820 => 69.83' , ( ) => {
42
+ assert . equal ( reputation ( 95832978796820 , 2 ) , 69.83 ) ;
43
+ } ) ;
44
+ it ( 'rep 10004392664120 => 61.002' , ( ) => {
45
+ assert . equal ( reputation ( 10004392664120 , 3 ) , 61.002 ) ;
46
+ } ) ;
47
+ it ( 'rep 30999525306309 => 65.4222' , ( ) => {
48
+ assert . equal ( reputation ( 30999525306309 , 4 ) , 65.4222 ) ;
49
+ } ) ;
50
+ it ( 'rep -37765258368568 => -16.19383' , ( ) => {
51
+ assert . equal ( reputation ( - 37765258368568 , 5 ) , - 16.19383 ) ;
52
+ } ) ;
53
+ it ( 'rep 334486135407077 => 74.719403' , ( ) => {
54
+ assert . equal ( reputation ( 334486135407077 , 6 ) , 74.719403 ) ;
55
+ } ) ;
56
+ it ( 'rep null => null' , ( ) => {
57
+ assert . equal ( reputation ( null , 7 ) , null ) ;
58
+ } ) ;
59
+ it ( 'rep undefined => undefined' , ( ) => {
60
+ assert . equal ( reputation ( undefined , 8 ) , undefined ) ;
61
+ } ) ;
62
+ it ( 'rep -1234123412342234 => -29.822227322' , ( ) => {
63
+ assert . equal ( reputation ( - 1234123412342234 , 9 ) , - 29.822227322 ) ;
64
+ } ) ;
65
+ it ( 'rep -22233344455 => 12.8769568338' , ( ) => {
66
+ assert . equal ( reputation ( - 22233344455 , 10 ) , 12.8769568338 ) ;
67
+ } ) ;
36
68
} )
0 commit comments