UNPKG

@zhiguang-gastrofy/capi

Version:

comany apis, including Northfork api and Gastrofy api

14 lines (11 loc) 343 B
export const parseImage = function( item:any ) { return item.images&&item.images.length&&item.images[0].url; }; export const decimalPrice = function( price:number ) { let value = price.toFixed( 2 ); return +value; } export const parsePrice = function( price:number ) { if( !price ) return 0; return decimalPrice( price / 100 ); };