当前位置: 首页>>代码示例>>C++>>正文


C++ MyMoneySecurity::smallestAccountFraction方法代码示例

本文整理汇总了C++中MyMoneySecurity::smallestAccountFraction方法的典型用法代码示例。如果您正苦于以下问题:C++ MyMoneySecurity::smallestAccountFraction方法的具体用法?C++ MyMoneySecurity::smallestAccountFraction怎么用?C++ MyMoneySecurity::smallestAccountFraction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MyMoneySecurity的用法示例。


在下文中一共展示了MyMoneySecurity::smallestAccountFraction方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

/**
 * Set the values based on the @param security
 */
void KInvestmentDetailsWizardPage::init2(const MyMoneySecurity& security)
{
  MyMoneySecurity tradingCurrency = MyMoneyFile::instance()->currency(security.tradingCurrency());
  m_investmentSymbol->setText(security.tradingSymbol());
  m_tradingMarket->setCurrentIndex(m_tradingMarket->findText(security.tradingMarket(), Qt::MatchExactly));
  m_fraction->setValue(MyMoneyMoney(security.smallestAccountFraction(), 1));
  m_tradingCurrencyEdit->setSecurity(tradingCurrency);

  m_investmentIdentification->setText(security.value("kmm-security-id"));
}
开发者ID:CGenie,项目名称:kmymoney,代码行数:13,代码来源:kinvestmentdetailswizardpage.cpp

示例2: KListViewItem

KInvestmentListItem::KInvestmentListItem(KListView* parent, const MyMoneyAccount& account)
  : KListViewItem(parent)
{
  bColumn5Negative = false;
  bColumn6Negative = false;
  bColumn7Negative = false;
  bColumn8Negative = false;
  bColumn9Negative = false;

  m_account = account;
  m_listView = parent;

  MyMoneySecurity security;
  MyMoneyFile* file = MyMoneyFile::instance();

  security = file->security(m_account.currencyId());
  m_tradingCurrency = file->security(security.tradingCurrency());

  int prec = MyMoneyMoney::denomToPrec(m_tradingCurrency.smallestAccountFraction());

  QValueList<MyMoneyTransaction> transactionList;
  // FIXME PRICE
  // equity_price_history history = equity.priceHistory();

  //column 0 (COLUMN_NAME_INDEX) is the name of the stock
  setText(COLUMN_NAME_INDEX, m_account.name());

  //column 1 (COLUMN_SYMBOL_INDEX) is the ticker symbol
  setText(COLUMN_SYMBOL_INDEX, security.tradingSymbol());

  //column 2 is the net value (price * quantity owned)
  MyMoneyPrice price = file->price(m_account.currencyId(), m_tradingCurrency.id());
  if(price.isValid()) {
    setText(COLUMN_VALUE_INDEX, (file->balance(m_account.id()) * price.rate(m_tradingCurrency.id())).formatMoney(m_tradingCurrency.tradingSymbol(), prec));
  } else {
    setText(COLUMN_VALUE_INDEX, "---");
  }

  //column 3 (COLUMN_QUANTITY_INDEX) is the quantity of shares owned
  prec = MyMoneyMoney::denomToPrec(security.smallestAccountFraction());
  setText(COLUMN_QUANTITY_INDEX, file->balance(m_account.id()).formatMoney("", prec));

  //column 4 is the current price
  // Get the price precision from the configuration
  prec = KMyMoneyGlobalSettings::pricePrecision();

  // prec = MyMoneyMoney::denomToPrec(m_tradingCurrency.smallestAccountFraction());
  if(price.isValid()) {
    setText(COLUMN_PRICE_INDEX, price.rate(m_tradingCurrency.id()).formatMoney(m_tradingCurrency.tradingSymbol(), prec));
  } else {
    setText(COLUMN_PRICE_INDEX, "---");
  }
}
开发者ID:sajidji94,项目名称:kmymoney2,代码行数:53,代码来源:kinvestmentlistitem.cpp

示例3: QWidget

kMyMoneyEdit::kMyMoneyEdit(const MyMoneySecurity& sec, QWidget *parent)
    : QWidget(parent)
{
  m_prec = MyMoneyMoney::denomToPrec(sec.smallestAccountFraction());
  init();
}
开发者ID:KDE,项目名称:kmymoney,代码行数:6,代码来源:kmymoneyedit.cpp


注:本文中的MyMoneySecurity::smallestAccountFraction方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。