Make decimal places in UI consistent#586
Make decimal places in UI consistent#586jordangeorge wants to merge 2 commits intoopenpredictionmarkets:mainfrom
Conversation
|
OK @jordangeorge the only other place I'm seeing more than two sig fig's is:
Settings for that are here: This is a stepped line chart. https://www.chartjs.org/docs/latest/samples/line/stepped.html I don't know if there is a "decimal," property in this chart. However under another chart type: https://www.chartjs.org/docs/latest/samples/area/line-drawtime.html They do show decimals: 2. Another thought ... is there a way we could globally adjust the number of significant figures displayed? E.g., it seems like we are making an opinion that the decimals should always be 2...what if someone wants up to say 4? I could see us putting a, 'sig figs display' setting in the game configuration and then pinging a service / the backend for this amount, which then gets pushed into a variable in the frontend that all of these pages and components inherit from. What do you think...? https://github.com/openpredictionmarkets/socialpredict/blob/main/backend/setup/setup.yaml |
| {error && <div className="error-message">Error: {error}</div>} | ||
| {projectionData && ( | ||
| <p>New Market Probability: {projectionData.projectedprobability.toFixed(4)}</p> | ||
| <p>New Market Probability: {projectionData.projectedprobability.toFixed(2)}</p> |
| </td> | ||
| <td className='px-6 py-4 whitespace-nowrap text-sm text-gray-300'> | ||
| {marketData.lastProbability.toFixed(3)} | ||
| {marketData.lastProbability.toFixed(2)} |
|
@jordangeorge, thanks for your work on this! When I mouse over the stepped line chart on dev I still get like 10 significant figures:
@pwdel, I like the idea of admins being able to adjust # of significant figures. But really, we don't have the precision for 10 significant figures to mean anything right now :') |
|
@astrosnat I talked through a solution to that here on this comment. Is this something you would be willing to look into...? #586 (comment) |
Totally, will do this today |
|
added new branch in main repo fix/decimal-places |
|
Closing this - it works, the custom significant figure support is going to be revisited later |





Addresses #443
Couldn't find an instance of 10 decimal places being used. I did, however, see 3 and 4. Let me know if I missed the 10.