presik_pos/app/tools.py
wilson gomez sanchez 5b6cdb8f46 minor fix
2021-04-13 10:10:17 -05:00

28 lines
549 B
Python

import os
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QDesktopWidget
current_dir = os.path.dirname(__file__)
def get_icon(name):
name = name if name else 'fork'
path_icon = os.path.join(current_dir, 'share', name + '.svg')
return QIcon(path_icon)
def to_numeric(number):
return str(round(number, 2))
def to_float(number, digits):
return str(round(number, 4))
def get_screen():
screen = QDesktopWidget().screenGeometry()
width = screen.width()
height = screen.height()
return width, height