|
import gradio as gr |
|
from modules.dollar_cost_averaging import dollar_cost_averaging |
|
|
|
examples = [ |
|
[1000, 9000, 560, 20000] |
|
] |
|
|
|
title = gr.Markdown("<h2 style='margin: 5px'>Dollar Cost Averaging Calculator</h2>") |
|
first_purchase = gr.Markdown("<h3 class='h3_title'>FIRST PURCHASE</h3>") |
|
old_price = gr.Textbox(label="Old Price", value=7850) |
|
old_quantity = gr.Textbox(label="Quantity", value=70) |
|
second_purchase = gr.Markdown("<h3 class='h3_title'>SECOND PURCHASE</h3>") |
|
new_price = gr.Textbox(label="New Price", value=6700) |
|
new_quantity = gr.Textbox(label="Quantity", value=70) |
|
|
|
input = [old_price, old_quantity, new_price, new_quantity] |
|
output = gr.HTML() |
|
component_rows= [first_purchase, old_price, old_quantity, second_purchase, new_price, new_quantity] |
|
|
|
|
|
def update_output(*args): |
|
return dollar_cost_averaging(*args) |
|
|