Below is (part of) the response when I make an API call to get my account info. Why are fields like “buying_power”, “portfolio_value”, “equity”, etc returned as string values instead of an actual number type? This would make working with these responses so much easier in strongly typed languages like Swift.
{
"status":"DISABLED",
"currency":"USD",
"buying_power":"316914.512",
"regt_buying_power":"137104.24",
"daytrading_buying_power":"316914.512",
"cash":"149138",
"portfolio_value":"95414.08",
"pattern_day_trader":false,
"trading_blocked":false,
"transfers_blocked":false,
"account_blocked":false,
"created_at":"2021-03-11T04:17:58.093853Z",
"trade_suspended_by_user":false,
"multiplier":"4",
"shorting_enabled":true,
"equity":"95414.08",
"last_equity":"95361.56",
"long_market_value":"0",
"short_market_value":"-53723.92",
"initial_margin":"26861.96",
"maintenance_margin":"16117.176",
"last_maintenance_margin":"16132.932",
"sma":"0",
"daytrade_count": 0
}
yassck02, i don’t mean to be rude but why would you even ask a question like this? That’s the way it is, they not gonna change it for you anyways. Just code to the spec and move on
I already coded to the spec so I was really asking out of curiosity - and also to suggest an enhancement for v3 
It just seems odd that they chose to require everyone that adopts this API to manually convert the value to a number before they use it in any sort of calculation. I was wondering if anyone had any insight into this decision
Well the main reason I can think of is that different programming languages handle big/small numbers and decimal in different ways if they are out of range or simply very big or very small. They may have did it for consistency. I might have read something like this in their docs but forgot where.
The decision to represent most numbers in the trading APIs as strings was primarily for consistency and accuracy across different SDKs and languages. As @rockbusiness mentioned, different languages handle numbers differently. Sometimes numbers can be automatically (and unintentionally) rounded, truncated, or represented with more precision than actually present. Using strings, one must explicitly translate the value into a number and, presumably, provide the intentioned representation. That is pretty much it.