13
13
* See the License for the specific language governing permissions and
14
14
* limitations under the License.
15
15
*/
16
- import { EventTags } from '../../modules/event_processor ' ;
16
+ import { EventTags } from '../../shared_types ' ;
17
17
import { LoggerFacade } from '../../modules/logging' ;
18
-
19
18
import {
20
19
LOG_LEVEL ,
21
20
LOG_MESSAGES ,
@@ -42,7 +41,7 @@ export function getRevenueValue(eventTags: EventTags, logger: LoggerFacade): num
42
41
return null ;
43
42
}
44
43
45
- const parsedRevenueValue = typeof rawValue === 'string' ? parseInt ( rawValue ) : rawValue ;
44
+ const parsedRevenueValue = typeof rawValue === 'string' ? parseInt ( rawValue ) : Math . trunc ( rawValue ) ;
46
45
47
46
if ( isFinite ( parsedRevenueValue ) ) {
48
47
logger . log ( LOG_LEVEL . INFO , LOG_MESSAGES . PARSED_REVENUE_VALUE , MODULE_NAME , parsedRevenueValue ) ;
@@ -66,7 +65,7 @@ export function getEventValue(eventTags: EventTags, logger: LoggerFacade): numbe
66
65
return null ;
67
66
}
68
67
69
- const parsedEventValue = typeof rawValue === 'string' ? parseFloat ( rawValue ) : rawValue ;
68
+ const parsedEventValue = typeof rawValue === 'string' ? parseFloat ( rawValue ) : rawValue ;
70
69
71
70
if ( isFinite ( parsedEventValue ) ) {
72
71
logger . log ( LOG_LEVEL . INFO , LOG_MESSAGES . PARSED_NUMERIC_VALUE , MODULE_NAME , parsedEventValue ) ;
@@ -75,4 +74,4 @@ export function getEventValue(eventTags: EventTags, logger: LoggerFacade): numbe
75
74
logger . log ( LOG_LEVEL . INFO , LOG_MESSAGES . FAILED_TO_PARSE_VALUE , MODULE_NAME , rawValue ) ;
76
75
return null ;
77
76
}
78
- }
77
+ }
0 commit comments