Locale.ToNumber (Civ5 API)

From Civilization Modding Wiki
Revision as of 20:38, 19 September 2012 by DonQuich (talk | contribs) (Bot update)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

This page is a part of the Lua and UI Reference (Civ5).


Function.png This function is a member of Locale.

This is a static method, invoke it with a dot.


Usage

string Locale.ToNumber(int netGPT, string arg1)


Returned Value

No description available.

Parameters

netGPT: No description available.
arg1: No description available.


Source code samples

Too many occurences. Only 50 out of 116 are listed.

Demographics.lua

UI/InGame/Popups/Demographics.lua
0135
instance.Best:SetText( Locale.ToNumber(best[1], "#,###,###,###") );
0138
instance.Average:SetText( Locale.ToNumber( GetAverage( m_PopulationTable, iPlayer ), "#,###,###,###" ) );
0143
instance.Worst:LocalizeAndSetText( Locale.ToNumber(worst[1], "#,###,###,###" ) );
0146
instance.Rank:SetText( Locale.ToNumber(GetRank( m_PopulationTable, iPlayer ), "#") );
0165
instance.Value:SetText( Locale.ToNumber(m_FoodTable[ iPlayer ], "#,###,###,###" ));
0173
instance.Average:SetText( Locale.ToNumber( GetAverage( m_FoodTable, iPlayer ), "#,###,###,###" ) );
0181
instance.Rank:SetText( Locale.ToNumber(GetRank( m_FoodTable, iPlayer ), "#") );
0200
instance.Value:SetText( Locale.ToNumber(m_ProductionTable[ iPlayer ], "#,###,###,###" ));
0208
instance.Average:SetText( Locale.ToNumber( GetAverage( m_ProductionTable, iPlayer ), "#,###,###,###" ) );
0236
instance.Value:SetText( Locale.ToNumber(m_GoldTable[ iPlayer ], "#,###,###,###" ));
0244
instance.Average:SetText( Locale.ToNumber( GetAverage( m_GoldTable, iPlayer ), "#,###,###,###" ) );
0252
instance.Rank:SetText( Locale.ToNumber(GetRank( m_GoldTable, iPlayer ), "#") );
0271
instance.Value:SetText( Locale.ToNumber(m_LandTable[ iPlayer ], "#,###,###,###" ));
0279
instance.Average:SetText( Locale.ToNumber( GetAverage( m_LandTable, iPlayer ), "#,###,###,###" ) );
0287
instance.Rank:SetText( Locale.ToNumber(GetRank( m_LandTable, iPlayer ), "#") );
0306
instance.Value:SetText( Locale.ToNumber(m_ArmyTable[ iPlayer ], "#,###,###,###" ));
0314
instance.Average:SetText( Locale.ToNumber( GetAverage( m_ArmyTable, iPlayer ), "#,###,###,###" ) );
0319
instance.Worst:LocalizeAndSetText( Locale.ToNumber(worst[1], "#,###,###,###") );
0368
instance.Best:SetText( Locale.ToNumber(best[1], "#'%'") );
0370
instance.Average:SetText( Locale.ToNumber( GetAverage( m_ApprovalTable, iPlayer ), "#'%'" ) );
0374
instance.Worst:LocalizeAndSetText( Locale.ToNumber(worst[1], "#'%'" ) );
0376
instance.Rank:SetText( Locale.ToNumber(GetRank( m_ApprovalTable, iPlayer ), "#") );
0411
instance.Value:SetText( Locale.ToNumber(m_LiteracyTable[ iPlayer ], "#'%'" ));
0423
instance.Rank:SetText( Locale.ToNumber(GetRank( m_LiteracyTable, iPlayer ), "#") );


EconomicGeneralInfo.lua

UI/InGame/Popups/EconomicGeneralInfo.lua
0181
Controls.TotalGoldValue:SetText( Locale.ToNumber( pPlayer:GetGold(), "#.##" ) );
0184
Controls.NetGoldValue:SetText( Locale.ToNumber( netGPT, "#.##" ) );
0188
Controls.ScienceLostValue:SetText( Locale.ToNumber( pPlayer:GetScienceFromBudgetDeficitTimes100() / 100, "#.##" ) );
0193
Controls.GrossGoldValue:SetText( "[COLOR_POSITIVE_TEXT]" .. Locale.ToNumber( pPlayer:CalculateGrossGoldTimes100() / 100, "#.##" ) .. "[ENDCOLOR]" );
0195
Controls.TotalExpenseValue:SetText( "[COLOR_NEGATIVE_TEXT]" .. Locale.ToNumber( pPlayer:CalculateInflatedCosts(), "#.##" ) .. "[ENDCOLOR]" );
0198
Controls.CityIncomeValue:SetText( Locale.ToNumber( pPlayer:GetGoldFromCitiesTimes100() / 100, "#.##" ) );
0212
instance.TradeIncomeValue:SetText( Locale.ToNumber( CityIncome, "#.##" ) );
0229
Controls.DiploIncomeValue:SetText( Locale.ToNumber( diploGPT, "#.##" ) );
0234
Controls.TradeIncomeValue:SetText( Locale.ToNumber( pPlayer:GetCityConnectionGoldTimes100() / 100, "#.##" ) );
0257
instance.TradeIncomeValue:SetText( Locale.ToNumber( tradeIncome, "#.##" ) );
0287
local fCostPer = Locale.ToNumber( iTotalUnitMaintenance / iPaidUnits , "#.##" );
0318
Controls.BuildingExpenseValue:SetText( Locale.ToNumber( pPlayer:GetBuildingGoldMaintenance(), "#.##" ) );
0332
instance.TradeIncomeValue:SetText( Locale.ToNumber( BuildingCost, "#.##" ) );
0359
Controls.TileExpenseValue:SetText( Locale.ToNumber( pPlayer:GetImprovementGoldMaintenance(), "#.##" ) );
0362
Controls.DiploExpenseValue:SetText( Locale.ToNumber( pPlayer:GetGoldPerTurnFromDiplomacy(), "#.##" ) );


EconomicGeneralInfo.lua (G&K)

DLC/Expansion/UI/InGame/Popups/EconomicGeneralInfo.lua
0237
Controls.ReligionIncomeValue:SetText( Locale.ToNumber( religionGPT, "#.##" ) );


EnemyUnitPanel.lua

UI/InGame/WorldView/EnemyUnitPanel.lua
0425
Controls.TheirStrengthValue:SetText( Locale.ToNumber(iTheirStrength / 100, "#.##") );
1432
Controls.TheirStrengthValue:SetText( Locale.ToNumber(theirUnitStrength / 100, "#.##"));
1438
Controls.MyStrengthValue:SetText( Locale.ToNumber(myCityStrength / 100, "#.##"));


HappinessInfo.lua

UI/InGame/Popups/HappinessInfo.lua
0222
instance.TradeIncomeValue:SetText( Locale.ToNumber( resource.Happiness, "#.##" ) );
0390
local iUnhappinessFromUnits = Locale.ToNumber( pPlayer:GetUnhappinessFromUnits() / 100, "#.##" );
0391
local iUnhappinessFromCityCount = Locale.ToNumber( pPlayer:GetUnhappinessFromCityCount() / 100, "#.##" );
0393
local iUnhappinessFromPop = Locale.ToNumber( pPlayer:GetUnhappinessFromCityPopulation() / 100, "#.##" );
0394
local iUnhappinessFromOccupiedCities = Locale.ToNumber( pPlayer:GetUnhappinessFromOccupiedCities() / 100, "#.##" );
0576
instance.TradeIncomeValue:SetText( Locale.ToNumber( fUnhappinessTimes100, "#.##" ) );


TopPanel.lua

UI/InGame/TopPanel.lua
0642
local iUnhappinessFromPop = Locale.ToNumber( unhappinessFromPop / 100, "#.##" );



The initial version of this page was created by the Civ5 API Bot, see the Civ5 API Reference FAQ. Some of the texts come from the 2kgames' wiki and most of code samples are copyrighted to Firaxis.
Functions' signatures were either copied from the 2kgames' wiki, or infered from the Lua source files and the binaries. Errors are possible.
Contributors may find help in the Contributors guide to the Civ5 API.