Merge pull request #4 from Ranzo/Checker_negative_numbers

0.6.1
This commit is contained in:
Risen 2023-05-29 14:13:48 +03:00 committed by GitHub
commit 953945ccf7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 5 additions and 12 deletions

View File

@ -114,7 +114,7 @@ def main():
values[6], values[4]) # p, t, h, md, d, st, mk, am, post, x values[6], values[4]) # p, t, h, md, d, st, mk, am, post, x
try: try:
result = calculating(cost, values[5], params['marge']) # cost, mod, marg result = calculating(abs(cost), values[5], params['marge']) # cost, mod, marg
except KeyError: except KeyError:
Sgi.popup_ok(new_marge) Sgi.popup_ok(new_marge)
result = 0 result = 0

View File

@ -1,7 +0,0 @@
Copyright <2023> <Risen>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -15,7 +15,7 @@ def cost_prise(p, t, h, md, d, st, mk, am, post, x):
x = int(x) # количество экземпляров x = int(x) # количество экземпляров
except ValueError: except ValueError:
x = 1 x = 1
result = (p / 1000 * t / 60 * h) + (md * d * (st / mk) + am + post) * x result = (abs(p) / 1000 * abs(t) / 60 * abs(h)) + (abs(md) * abs(d) * (abs(st) / abs(mk)) + abs(am) + abs(post)) * x
return round(result, 2) return round(result, 2)

View File

@ -1 +0,0 @@
lang_list = ['Русский', 'English']

View File

@ -21,3 +21,4 @@ themes_list = ['Black', 'BlueMono', 'BluePurple', 'BrightColors', 'BrownBlue', '
'Material1', 'Material2', 'NeutralBlue', 'Purple', 'Python', 'PythonPlus', 'Reddit', 'Reds', 'Material1', 'Material2', 'NeutralBlue', 'Purple', 'Python', 'PythonPlus', 'Reddit', 'Reds',
'SandyBeach', 'SystemDefault', 'SystemDefault1', 'SystemDefaultForReal', 'Tan', 'TanBlue', 'SandyBeach', 'SystemDefault', 'SystemDefault1', 'SystemDefaultForReal', 'Tan', 'TanBlue',
'TealMono', 'Topanga'] 'TealMono', 'Topanga']
lang_list = ['Русский', 'English']

View File

@ -3,8 +3,8 @@ import PySimpleGUI as Sgi
import gettext import gettext
from texts import amortization_calc, new_sets from texts import amortization_calc, new_sets
from themes_list import themes_list from lists import themes_list, lang_list
from lang_list import lang_list
with open('setts.json') as file: with open('setts.json') as file:
old_data = json.load(file) old_data = json.load(file)