@@ -84,7 +84,7 @@ func New(config Config) *Model {
8484 id : id ,
8585 width : 80 ,
8686 config : config ,
87- priceNoChangeSegment : u .ConvertFloatToString (config .Asset .QuotePrice .Price , config .Asset .Meta .IsVariablePrecision ),
87+ priceNoChangeSegment : u .ConvertFloatToStringWithCommas (config .Asset .QuotePrice .Price , config .Asset .Meta .IsVariablePrecision ),
8888 priceChangeSegment : "" ,
8989 }
9090}
@@ -111,8 +111,8 @@ func (m *Model) Update(msg tea.Msg) (*Model, tea.Cmd) {
111111 m .priceStyle = lipgloss .NewStyle ().Foreground (lipgloss .Color ("15" )).Background (lipgloss .Color ("" ))
112112 m .frame = 0
113113
114- oldPrice := u .ConvertFloatToString (m .config .Asset .QuotePrice .Price , m .config .Asset .Meta .IsVariablePrecision )
115- newPrice := u .ConvertFloatToString (msg .QuotePrice .Price , msg .Meta .IsVariablePrecision )
114+ oldPrice := u .ConvertFloatToStringWithCommas (m .config .Asset .QuotePrice .Price , m .config .Asset .Meta .IsVariablePrecision )
115+ newPrice := u .ConvertFloatToStringWithCommas (msg .QuotePrice .Price , msg .Meta .IsVariablePrecision )
116116
117117 if msg .QuotePrice .Price > m .config .Asset .QuotePrice .Price {
118118 m .priceChangeDirection = 1
@@ -147,7 +147,7 @@ func (m *Model) Update(msg tea.Msg) (*Model, tea.Cmd) {
147147
148148 // If symbol has changed or price has not changed then just update the asset
149149 m .config .Asset = msg
150- m .priceNoChangeSegment = u .ConvertFloatToString (msg .QuotePrice .Price , msg .Meta .IsVariablePrecision )
150+ m .priceNoChangeSegment = u .ConvertFloatToStringWithCommas (msg .QuotePrice .Price , msg .Meta .IsVariablePrecision )
151151 m .priceChangeSegment = ""
152152
153153 return m , nil
@@ -366,7 +366,7 @@ func textPosition(asset *c.Asset, styles c.Styles) string {
366366 positionValue = u .ValueText (asset .Holding .Value , styles ) +
367367 styles .TextLight (
368368 " (" +
369- u .ConvertFloatToString (asset .Holding .Weight , asset .Meta .IsVariablePrecision )+ "%" +
369+ u .ConvertFloatToStringWithCommas (asset .Holding .Weight , asset .Meta .IsVariablePrecision )+ "%" +
370370 ")" )
371371 }
372372 if asset .Holding .TotalChange .Amount != 0.0 {
@@ -385,19 +385,19 @@ func textQuoteExtended(asset *c.Asset, styles c.Styles) string {
385385 }
386386
387387 if asset .Class == c .AssetClassFuturesContract {
388- return styles .Text (u .ConvertFloatToString (asset .QuoteFutures .IndexPrice , asset .Meta .IsVariablePrecision )) +
388+ return styles .Text (u .ConvertFloatToStringWithCommas (asset .QuoteFutures .IndexPrice , asset .Meta .IsVariablePrecision )) +
389389 "\n " +
390- styles .Text (u .ConvertFloatToString (asset .QuoteFutures .Basis , false )) + "%"
390+ styles .Text (u .ConvertFloatToStringWithCommas (asset .QuoteFutures .Basis , false )) + "%"
391391 }
392392
393393 if asset .QuotePrice .PriceOpen == 0.0 {
394- return styles .Text (u .ConvertFloatToString (asset .QuotePrice .PricePrevClose , asset .Meta .IsVariablePrecision )) +
394+ return styles .Text (u .ConvertFloatToStringWithCommas (asset .QuotePrice .PricePrevClose , asset .Meta .IsVariablePrecision )) +
395395 "\n "
396396 }
397397
398- return styles .Text (u .ConvertFloatToString (asset .QuotePrice .PricePrevClose , asset .Meta .IsVariablePrecision )) +
398+ return styles .Text (u .ConvertFloatToStringWithCommas (asset .QuotePrice .PricePrevClose , asset .Meta .IsVariablePrecision )) +
399399 "\n " +
400- styles .Text (u .ConvertFloatToString (asset .QuotePrice .PriceOpen , asset .Meta .IsVariablePrecision ))
400+ styles .Text (u .ConvertFloatToStringWithCommas (asset .QuotePrice .PriceOpen , asset .Meta .IsVariablePrecision ))
401401
402402}
403403
@@ -429,9 +429,9 @@ func textPositionExtended(asset *c.Asset, styles c.Styles) string {
429429 return ""
430430 }
431431
432- return styles .Text (u .ConvertFloatToString (asset .Holding .UnitCost , asset .Meta .IsVariablePrecision )) +
432+ return styles .Text (u .ConvertFloatToStringWithCommas (asset .Holding .UnitCost , asset .Meta .IsVariablePrecision )) +
433433 "\n " +
434- styles .Text (u .ConvertFloatToString (asset .Holding .Quantity , asset .Meta .IsVariablePrecision ))
434+ styles .Text (u .ConvertFloatToStringWithCommas (asset .Holding .Quantity , asset .Meta .IsVariablePrecision ))
435435
436436}
437437
@@ -451,9 +451,9 @@ func textQuoteRange(asset *c.Asset, styles c.Styles) string {
451451 if asset .Class == c .AssetClassFuturesContract {
452452
453453 if asset .QuotePrice .PriceDayHigh != 0.0 && asset .QuotePrice .PriceDayLow != 0.0 {
454- return u .ConvertFloatToString (asset .QuotePrice .PriceDayLow , asset .Meta .IsVariablePrecision ) +
454+ return u .ConvertFloatToStringWithCommas (asset .QuotePrice .PriceDayLow , asset .Meta .IsVariablePrecision ) +
455455 styles .Text (" - " ) +
456- u .ConvertFloatToString (asset .QuotePrice .PriceDayHigh , asset .Meta .IsVariablePrecision ) +
456+ u .ConvertFloatToStringWithCommas (asset .QuotePrice .PriceDayHigh , asset .Meta .IsVariablePrecision ) +
457457 "\n " +
458458 asset .QuoteFutures .Expiry
459459 }
@@ -463,13 +463,13 @@ func textQuoteRange(asset *c.Asset, styles c.Styles) string {
463463 }
464464
465465 if asset .QuotePrice .PriceDayHigh != 0.0 && asset .QuotePrice .PriceDayLow != 0.0 {
466- return u .ConvertFloatToString (asset .QuotePrice .PriceDayLow , asset .Meta .IsVariablePrecision ) +
466+ return u .ConvertFloatToStringWithCommas (asset .QuotePrice .PriceDayLow , asset .Meta .IsVariablePrecision ) +
467467 styles .Text (" - " ) +
468- u .ConvertFloatToString (asset .QuotePrice .PriceDayHigh , asset .Meta .IsVariablePrecision ) +
468+ u .ConvertFloatToStringWithCommas (asset .QuotePrice .PriceDayHigh , asset .Meta .IsVariablePrecision ) +
469469 "\n " +
470- u .ConvertFloatToString (asset .QuoteExtended .FiftyTwoWeekLow , asset .Meta .IsVariablePrecision ) +
470+ u .ConvertFloatToStringWithCommas (asset .QuoteExtended .FiftyTwoWeekLow , asset .Meta .IsVariablePrecision ) +
471471 styles .Text (" - " ) +
472- u .ConvertFloatToString (asset .QuoteExtended .FiftyTwoWeekHigh , asset .Meta .IsVariablePrecision )
472+ u .ConvertFloatToStringWithCommas (asset .QuoteExtended .FiftyTwoWeekHigh , asset .Meta .IsVariablePrecision )
473473 }
474474
475475 return ""
@@ -501,14 +501,14 @@ func textQuoteRangeLabels(asset *c.Asset, styles c.Styles) string {
501501func textVolumeMarketCap (asset * c.Asset ) string {
502502
503503 if asset .Class == c .AssetClassFuturesContract {
504- return u .ConvertFloatToString (asset .QuoteFutures .OpenInterest , true ) +
504+ return u .ConvertFloatToStringWithCommas (asset .QuoteFutures .OpenInterest , true ) +
505505 "\n " +
506- u .ConvertFloatToString (asset .QuoteExtended .Volume , true )
506+ u .ConvertFloatToStringWithCommas (asset .QuoteExtended .Volume , true )
507507 }
508508
509- return u .ConvertFloatToString (asset .QuoteExtended .MarketCap , true ) +
509+ return u .ConvertFloatToStringWithCommas (asset .QuoteExtended .MarketCap , true ) +
510510 "\n " +
511- u .ConvertFloatToString (asset .QuoteExtended .Volume , true )
511+ u .ConvertFloatToStringWithCommas (asset .QuoteExtended .Volume , true )
512512}
513513func textVolumeMarketCapLabels (asset * c.Asset , styles c.Styles ) string {
514514
@@ -537,14 +537,14 @@ func textMarketState(asset *c.Asset, styles c.Styles) string {
537537
538538func quoteChangeText (change float64 , changePercent float64 , isVariablePrecision bool , styles c.Styles ) string {
539539 if change == 0.0 {
540- return styles .TextPrice (changePercent , " " + u .ConvertFloatToString (change , isVariablePrecision )+ " (" + u .ConvertFloatToString (changePercent , false )+ "%)" )
540+ return styles .TextPrice (changePercent , " " + u .ConvertFloatToStringWithCommas (change , isVariablePrecision )+ " (" + u .ConvertFloatToStringWithCommas (changePercent , false )+ "%)" )
541541 }
542542
543543 if change > 0.0 {
544- return styles .TextPrice (changePercent , "↑ " + u .ConvertFloatToString (change , isVariablePrecision )+ " (" + u .ConvertFloatToString (changePercent , false )+ "%)" )
544+ return styles .TextPrice (changePercent , "↑ " + u .ConvertFloatToStringWithCommas (change , isVariablePrecision )+ " (" + u .ConvertFloatToStringWithCommas (changePercent , false )+ "%)" )
545545 }
546546
547- return styles .TextPrice (changePercent , "↓ " + u .ConvertFloatToString (change , isVariablePrecision )+ " (" + u .ConvertFloatToString (changePercent , false )+ "%)" )
547+ return styles .TextPrice (changePercent , "↓ " + u .ConvertFloatToStringWithCommas (change , isVariablePrecision )+ " (" + u .ConvertFloatToStringWithCommas (changePercent , false )+ "%)" )
548548}
549549
550550func textSeparator (width int , styles c.Styles ) string {
0 commit comments