All Questions
20 questions
0
votes
0
answers
29
views
wht is wrong with my buy function and sell function
it keeps showing
:( buy handles valid purchase
expected to find "112.00" in page, but it wasn't found
@app.route("/buy", methods=["GET", "POST"])
@...
0
votes
1
answer
97
views
FINANCE SELL : DROPDOWN MENU not showing any option DESPITE having look for solutions
This is my first time posting on reddit asking for help : I've been so far going through cs50 on ressources online when I got stuck, but here I can't figure it out even tho with the numerous online ...
0
votes
1
answer
190
views
Cs50 Finance :(sell handle valid sales :values appearing in index table but check50 doesnt recognise it
updated the code to display history properly,ie when sold shows negative,and when bought shows positive
updated index to remove entire row when stocks is 0
I cant figure out why check 50 is not ...
0
votes
1
answer
59
views
Buy/Sell on Index - button attributes & form value issues
I've got a couple issues adding my own buy/sell buttons to the index page.
First, each "Buy" or "Sell" buttons opens up the form for all of the table rows. How can I modify these ...
0
votes
0
answers
291
views
Is there a bug in check50 cs50/problems/2021/x/finance?
I completed problem set 9 and works as supposed, but with check50 I get the following result:
:( sell handles valid sale expected to find "56.00" in page, but it wasn't found
For testing ...
0
votes
1
answer
578
views
Finance PROBLEM with lookup: TypeError: quote_from_bytes() expected bytes
I have Finance barely ready but like most codes, it has a buggy near the finish line.
I have a problem with lookup. Always return None. I check it.
and Terminal shows this error:
TypeError: ...
0
votes
0
answers
234
views
Pset8 Finance - Sell - Fails to update user's cash in "users" table, and fails to insert sold shares into "portfolio" table
Big picture: On the sell page of the CS50 Finance, I select the shares symbol I want to sell, and enter the number of shares, and click the Sell button, which redirects me to the homepage, but the ...
-1
votes
2
answers
88
views
finance how to compare requested shares to shares owned
I'm having trouble trying to figure out how to write the sql statement to receive the amount of shares owned so I can compare it to the number requested, and if owned - requested < 0, don't let ...
0
votes
1
answer
510
views
pset 8 finance: :( sell handles valid sale
:)
Struggle with the last check. Get this error message:
expected to find "56.00" in page, but it wasn't found
Tried the same approach like I used for the buy-function. Create an extra template to ...
0
votes
1
answer
106
views
pset8 finance: Problem with calculaton for "/sell"
I'm implementing the "sell" function and have a problem with the calculation of the new value for "share" and "cash".
Here is my code:
@app.route("/sell", methods=["GET", "POST"])
@login_required
...
1
vote
1
answer
1k
views
CS50 PSET7 Finance: in SELL; expected to find select field with name "symbol", but none found
My CS50 finance app passes all check50 tests except just one in the SELL component. I just can't find the error and need thoughts/ideas / tried a lot ( read: a-lot). My code was created in 2017 and ...
0
votes
1
answer
2k
views
CS50 finance: Sell function.(Dropdown list of user shares NOT displayed via sell.html)
Purpose of Sell: to make sure the shares bought can be sold by selecting it through a dropdown list displaying symbols of share bought. I am trying to replicate the cs50 finance default page.
I have ...
0
votes
1
answer
513
views
Pset7 Finance, Sell problem with POST requests
My problem is that I'm not getting any value back from my select form. I pass a list of stocks to the jinja template via return render_template("sell.html", stocks=stocks) and on the sell.html page I ...
0
votes
1
answer
410
views
PSET7/C$50Finance/buy
I have created two tables in my database named : portfolio and user_data. portfolio has fields as: user_id, Symbol, Name, Shares, Price, Total, Datetime all of them "NOT UNIQUE" so as to let the user ...
0
votes
1
answer
443
views
PSET7/C$50Finance/sell
My portfolio table has fields user_id,Name,Symbol,Shares,Price,Total,Datetime showing who bought what at what price & when aka a record of all users buying their stocks. Now, if there is a user ...
0
votes
1
answer
531
views
Jinja2 + Python error "TypeError: non-empty format string passed to object.__format__"
I tried to implement sell, but there's a problem in the index template that came up when the website tried to redirect from sell.html to index.html after the sail of stocks was done.
For reference, ...
0
votes
1
answer
50
views
sell.php doesn't return error when the stocks doesn't exist in the user's portfolio
<?php
require("../includes/config.php");
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
if (empty($_POST["stock"]))
{
apologize("You must provide the stock you want to sell.");
}
...
0
votes
1
answer
202
views
Pset7 Sell: can't display dropdown menu items
Trying to implement a dropdown menu in sell_form.php so that the user can choose one of the stocks he/she owns and sell it. However, the dropdown menu doesn't seem to be working properly, can someone ...
2
votes
1
answer
77
views
Pset7 How to Program Popup?
I'm trying to create a popup after a user successfully sells a stock. I want it to look like Chrome's confirm form resubmission popup
I'm pretty sure I need javascript, html, and css, but I'm not ...
0
votes
1
answer
241
views
sell.php, not able to sell
For some reason, the portfolio does not change after i sell the stock, can anyone please help.here's the code, i need some hints of whats going wrong.thanks in advance.
sell.php : http://tny.cz/...