import Taro from '@tarojs/taro' ; export const getStorageData = async ( key ) => { let result ; try { const { data } = await Taro . getStorage ( { key } ) ; result = data ; } catch ( error ) { console . log ( error ) ; } return result ; } ; export const fomatFloat = ( num , n ) => { let f = parseFloat ( num as string ) ; if ( Number . isNaN ( f ) ) { return false ; } f = Math . round ( ( num as number ) * Math . pow ( 10 , n ) ) / Math . pow ( 10 , n ) ; return f ; } ;