Lines Matching refs:value

103 	// If changes where not applied the value has become a new expression
195 ExpressionTextView::SetValue(BString value, BString decimalSeparator)
197 // save the value
198 fCurrentValue = value;
204 float stringWidth = font.StringWidth(value);
211 if (value.CountChars() > 3 && stringWidth > viewWidth) {
214 if (value[0] == '-')
217 // calculate the value of the exponent
219 int32 offset = value.FindFirst(decimalSeparator);
221 exponent = value.CountChars() - decimalSeparatorWidth - firstDigit;
222 value.InsertChars(decimalSeparator, firstDigit + 1);
225 // if the value is 0.01 or larger then scientific notation
227 if (value[firstDigit] != '0' || value[firstDigit + 2] != '0'
228 || value[firstDigit + 3] != '0') {
232 value.Remove(offset, decimalSeparatorWidth);
234 // check for negative exponent value
236 while (value[firstDigit] == '0') {
237 value.Remove(firstDigit, 1);
242 value.InsertChars(decimalSeparator, firstDigit + 1);
247 BString temp = value;
254 value.Remove(offset, decimalSeparatorWidth);
255 value.InsertChars(decimalSeparator, firstDigit + 1);
263 value.Truncate(40);
266 offset = value.CountChars() - 1;
267 value << "E" << exponent;
270 offset = value.CountChars() - 1;
274 stringWidth = font.StringWidth(value);
277 if (value.CharAt(offset) != decimalSeparator)
278 lastRemovedDigit = value[offset];
279 value.Remove(offset--, 1);
280 stringWidth = font.StringWidth(value);
284 if (value.CharAt(offset) == decimalSeparator) {
285 value.Remove(offset, decimalSeparatorWidth);
293 if (value.CharAt(offset) == decimalSeparator)
296 digit = (int)(value[offset]) - '0' + 1; // ascii to int + 1
300 value.SetByteAt(offset, '0');
304 if (value.CharAt(firstDigit + 1) == decimalSeparator) {
305 value.SetByteAt(firstDigit + decimalSeparatorWidth, '0');
306 value.RemoveChars(firstDigit, decimalSeparatorWidth);
307 value.InsertChars(decimalSeparator, firstDigit);
309 value.Insert('1', 1, firstDigit);
311 // remove the exponent value and the last digit
312 offset = value.FindFirst('E');
314 offset = value.CountChars();
316 value.Truncate(--offset);
321 value << 'E' << exponent;
323 // increase the current digit value with one
324 value.SetByteAt(offset, char(digit + 48));
327 offset = value.FindFirst('E');
329 offset = value.CountChars();
336 if (value.FindFirst(decimalSeparator) != B_ERROR) {
338 while (value[offset] == '0')
339 value.Remove(offset--, 1);
342 if (value.CharAt(offset) == decimalSeparator)
343 value.Remove(offset, decimalSeparatorWidth);
347 // set the new value
348 SetExpression(value);