Article ID: 184884
Article Last Modified on 1/14/2000
CURRENCY cy; LPWSTR szInput = L"$1,234,567.89"; MessageBox(hWnd, szInput, L"Currency Input String", MB_OK); // Pad output string with "." LPWSTR szOutput = L"......................................"; LPWSTR szNoDollarSign = wcsstr(szInput, '$'); szNoDollarSign = szNoDollarSign ? (szNoDollarSign + 1) : szInput; VarCyFromStr( szNoDollarSign, LANG_USER_DEFAULT, 0, &cy ); unsigned long lFinal = (unsigned long)(cy.int64/100); wsprintf( szOutput, TEXT( "%lu" ), lFinal ); MessageBox(hWnd, szOutput, L"Currency converted String", MB_OK);
CURRENCY cy; LPWSTR szInput = L"$1,234,567.89"; MessageBox(hWnd, szInput, L"Currency Input String", MB_OK); // Pad output string with "." LPWSTR szOutput = L"......................................"; VarCyFromStr( szInput, LANG_USER_DEFAULT, 0, &cy ); unsigned long lFinal = (unsigned long)(cy.int64/100); wsprintf( szOutput, TEXT( "%lu" ), lFinal ); MessageBox(hWnd, szOutput, L"Currency converted String", MB_OK);
Keywords: kbbug KB184884