移除无用的价格Clamp检测,仅保留8位小数截断
This commit is contained in:
parent
e7a551ea8b
commit
447eb9ef4f
@ -342,14 +342,14 @@ public class MarketDataService : IMarketDataService
|
|||||||
source = "Tiingo";
|
source = "Tiingo";
|
||||||
}
|
}
|
||||||
|
|
||||||
// 写入缓存,保留8位小数,强制转换为12位整数+8位小数,避免MySql字段溢出
|
// 写入缓存,保留8位小数
|
||||||
var cacheEntity = new MarketPriceCache
|
var cacheEntity = new MarketPriceCache
|
||||||
{
|
{
|
||||||
Id = cacheKey,
|
Id = cacheKey,
|
||||||
Symbol = symbol.ToUpper(),
|
Symbol = symbol.ToUpper(),
|
||||||
AssetType = assetType.ToUpper(),
|
AssetType = assetType.ToUpper(),
|
||||||
Price = Math.Round(Math.Clamp(response.Price, 0, 999999999999.99999999m), 8),
|
Price = Math.Round(response.Price, 8),
|
||||||
PreviousClose = response.PreviousClose > 0 ? Math.Round(Math.Clamp(response.PreviousClose.Value, 0, 999999999999.99999999m), 8) : null,
|
PreviousClose = response.PreviousClose > 0 ? Math.Round(response.PreviousClose.Value, 8) : null,
|
||||||
Source = source,
|
Source = source,
|
||||||
FetchedAt = DateTime.Now,
|
FetchedAt = DateTime.Now,
|
||||||
ExpiredAt = GetCacheExpirationTime(assetType)
|
ExpiredAt = GetCacheExpirationTime(assetType)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user