Skip to content

Commit 8fe7608

Browse files
authored
Merge pull request #225 from hummingbot/feat/add_more_decimals_to_grid
(feat) add decimals to grid
2 parents af3f7fd + 75f7e14 commit 8fe7608

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

frontend/pages/config/grid_strike/user_inputs.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,12 @@ def user_inputs():
109109
# Grid Ranges Configuration
110110
with st.expander("Grid Ranges", expanded=True):
111111
grid_ranges = []
112-
num_ranges = st.number_input("Number of Grid Ranges", min_value=1, max_value=5, value=1)
112+
c1, c2 = st.columns(2)
113+
with c1:
114+
num_ranges = st.number_input("Number of Grid Ranges", min_value=1, max_value=5, value=1)
115+
with c2:
116+
decimals = st.number_input("Decimals to Display", min_value=0, max_value=20, value=4)
117+
fmt = f"%.{decimals}f"
113118
for i in range(num_ranges):
114119
st.markdown(f"#### Range {i}")
115120
# Price configuration
@@ -126,14 +131,16 @@ def user_inputs():
126131
start_price = st.number_input(
127132
f"Start Price {i}",
128133
value=default_min,
129-
key=f"start_price_{i}"
134+
key=f"start_price_{i}",
135+
format=fmt
130136
)
131137
with c3:
132138
# Set default end price based on side
133139
end_price = st.number_input(
134140
f"End Price {i}",
135141
value=default_max,
136-
key=f"end_price_{i}"
142+
key=f"end_price_{i}",
143+
format=fmt
137144
)
138145
with c4:
139146
total_amount_pct = st.number_input(

0 commit comments

Comments
 (0)